-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Expose MASConstraintMaker's view property #61
Comments
I thought it'd be worth to point out that for a single edge, you can write like this: Perhaps it would be nice be able to do the same with edges/sizes, something like this: I really like how auto-boxing is implemented in Expecta, and I think we could borrow it for Masonry. Just look how beautiful this would be:
In fact, I'm willing to give it a shot if it's fine with you @cloudkite :) |
@nickynick Seems reasonable as a fix for this issue—it's much more semantic and overall simpler than my suggestion. Especially if it can be done without breaking the API. 👍 |
@eric-horacek those changes are now in the latest cocoapods release. Closing but if it doesn't cover your use case or you still think its worthwhile please reopen, thanks! |
First off, thanks for the amazing library! You've successfully made writing autolayout code a breeze.
It would be helpful to have
MASConstraintMaker
'sview
property exposed so that the following code could be written:This way, constraints could be defined relative to the view's superview, regardless of if the superview is changed down the line in your implementation.
Additionally, this means that copy-pasting layout code when writing it would result in less occurrences of:
Where view2 is constrained to view1's superview, which is an easy to miss but hard to debug error.
The text was updated successfully, but these errors were encountered: