Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of undeclared type Constraint #48

Closed
ondrejrohon opened this issue Feb 9, 2015 · 3 comments
Closed

Use of undeclared type Constraint #48

ondrejrohon opened this issue Feb 9, 2015 · 3 comments

Comments

@ondrejrohon
Copy link

Hey guys,

I'm not sure If I just made mistake in integration of Snap in my project, but I get this error when I try to create property of type constraint in one of my classes.
I use snap on other places and it works well, but now I need to reference particular constraint. Any ideas what might be wrong?
I followed instructions for integrating snap in read me of this repository.

Thanks for help.

@ondrejrohon
Copy link
Author

I tried one more thing, but unfortunately still have the same issue.
I removed Snap as submodule, and tried adding it with pre-release version of Cocoapods instead.

Does referencing constraints work for you? Or have I made some mistake adding Snap to my project?

@robertjpayne
Copy link
Member

@JohnnyRuvac can you post some sample code? Not really sure I follow what you're doing.

@ondrejrohon
Copy link
Author

Hi, I found what was the problem. I forgot to import Snap in class where I wanted to use it.
Actually, I didn't know that you have to import it. Maybe it might be nice to mention it in read me somewhere? Because I thought that using swift, you don't have to import manually, everything is already there. This is clearly exception, because it is external framework? It is also a bit weird for me, that snp_makeConstraints was working on UIView without importing snap.

For clarity, here is link to a gist: https://gist.github.com/JohnnyRuvac/51e644da3f3bd65dbda2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants