Created
February 8, 2016 08:08
-
-
Save danstepanov/7bf6c44dbc138a690949 to your computer and use it in GitHub Desktop.
This file contains 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
func labelConstraints() { | |
// Center button in Page View | |
NSLayoutConstraint( | |
item: label, | |
attribute: .CenterX, | |
relatedBy: .Equal, | |
toItem: view, | |
attribute: .CenterX, | |
multiplier: 1.0, | |
constant: 0.0) | |
.active = true | |
// Set Width to be 80% of the Page View Width | |
NSLayoutConstraint( | |
item: label, | |
attribute: .Width, | |
relatedBy: .Equal, | |
toItem: view, | |
attribute: .Width, | |
multiplier: 0.8, | |
constant: 0.0) | |
.active = true | |
// Set Y Position Relative to Bottom of Page View | |
NSLayoutConstraint( | |
item: label, | |
attribute: .CenterY, | |
relatedBy: .Equal, | |
toItem: view, | |
attribute: .CenterY, | |
multiplier: 1.0, | |
constant: 0.0) | |
.active = true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment