Skip to content

Instantly share code, notes, and snippets.

@Thomvis
Last active August 29, 2015 14:04
Show Gist options
  • Save Thomvis/253d6c5de06f9a372a5b to your computer and use it in GitHub Desktop.
Save Thomvis/253d6c5de06f9a372a5b to your computer and use it in GitHub Desktop.

On iOS 8 beta 4, this constraint:

[NSLayoutConstraint constraintWithItem:_galleryView 
                             attribute:NSLayoutAttributeLeading 
                             relatedBy:NSLayoutRelationEqual 
                                toItem:self.view 
                             attribute:NSLayoutAttributeLeft 
                            multiplier:1.0f 
                              constant:0];

causes the following exception to be thrown:

Fatal Exception: NSInvalidArgumentException
*** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: 
A constraint cannot be made between a leading/trailing attribute and a right/left attribute. 
Use leading/trailing for both or neither.
@Thomvis
Copy link
Author

Thomvis commented Jul 25, 2014

And yes, the constraint doesn't make much sense to begin with, but it did work on iOS 7.

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