Last active
February 8, 2016 07:54
-
-
Save danstepanov/46a76969ebf0c4fccdea to your computer and use it in GitHub Desktop.
Revisions
-
danstepanov revised this gist
Feb 8, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ func buttonConstraints() { // Center button in Page View NSLayoutConstraint( item: button, -
danstepanov created this gist
Feb 8, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ func buttonConstraint() { // Center button in Page View NSLayoutConstraint( item: button, attribute: .CenterX, relatedBy: .Equal, toItem: view, attribute: .CenterX, multiplier: 1.0, constant: 0.0) .active = true // Set Width to be 30% of the Page View Width NSLayoutConstraint( item: button, attribute: .Width, relatedBy: .Equal, toItem: view, attribute: .Width, multiplier: 0.3, constant: 0.0) .active = true // Set Y Position Relative to Bottom of Page View NSLayoutConstraint( item: button, attribute: .Bottom, relatedBy: .Equal, toItem: view, attribute: .Bottom, multiplier: 0.9, constant: 0.0) .active = true }