Created
January 28, 2015 07:10
-
-
Save hamada-lemois/244f1c78f189410cdf2d to your computer and use it in GitHub Desktop.
SwiftでConstraint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var topConstraint = NSLayoutConstraint( | |
| item: view, | |
| attribute: .Top, | |
| relatedBy: .Equal, | |
| toItem: subView, | |
| attribute: .Top, | |
| multiplier: 1, | |
| constant: 0) | |
| var leadingConstraint = NSLayoutConstraint( | |
| item: view, | |
| attribute: .Leading, | |
| relatedBy: .Equal, | |
| toItem: subView, | |
| attribute: .Leading, | |
| multiplier: 1, | |
| constant: 0) | |
| var trailingConstraint = NSLayoutConstraint( | |
| item: view, | |
| attribute: .Trailing, | |
| relatedBy: .Equal, | |
| toItem: subView, | |
| attribute: .Trailing, | |
| multiplier: 1, | |
| constant: 0) | |
| var bottomConstraint = NSLayoutConstraint( | |
| item: view, | |
| attribute: .Bottom, | |
| relatedBy: .Equal, | |
| toItem: subView, | |
| attribute: .Bottom, | |
| multiplier: 1, | |
| constant: 0) | |
| view.addConstraints([topConstraint, leadingConstraint, trailingConstraint, bottomConstraint]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment