-
Notifications
You must be signed in to change notification settings - Fork 735
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
Add shorthand edges pin functions #176
base: master
Are you sure you want to change the base?
Conversation
bf7c7f1
to
912e033
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @revolter!
I do like the autoPinEdge:toSameEdgeOfView:
signatures.
I left one question on the other API.
I'd love to hear some more community feedback before merging this in. Once it's in, we can never go back. Any one else have thoughts?
- (NSLayoutConstraint *)autoPinEdge:(ALEdge)edge toSameEdgeOfView:(ALView *)otherView withOffset:(CGFloat)offset relation:(NSLayoutRelation)relation; | ||
|
||
/** Pins the edges of the view to the edges of another view. */ | ||
- (PL__NSArray_of(NSLayoutConstraint *) *)autoPinEdgesToEdgesOfView:(ALView *)otherView; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one seems a bit niche to me. Can you explain the use case for this one that isn't covered by autoPinEdgesToSuperviewEdges
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, as the name suggests, this is used to match 2 views that aren't in a parent - child relationship. For example, say I have a UIImageView
and a UIView
that I want the view to be in the same position and with the same size of the image view, but I can't add it as a subview to it, because you're not supposed to do that.
My pleasure! Thank you all for the library.
Of course you do, as it's taken from the
Makes sense, I'll just wait here 😄 |
Having
sameAxis
functions, I don't see why shouldn't we havesameEdge
functions too. And already this would clear some code from my codebase, so you don't have to figure out if theedge
andtoEdge
parameters are the same one.