You can associate a constraint in a storyboard with a view controller class in the same way as you connect a user interface element.
Just find the constraints in your storyboard, make the workspace a split view, and drag the constraint onto the appropriate view controller class.
Sometimes, if you want to animate a change in position, you can update the restriction, for example:
self.theConstraint?.constant = 100 self.view.setNeedsUpdateConstraints() UIView.animateWithDuration(0.7) { () -> Void in self.view.layoutIfNeeded() }
block.
That's all.
Surly source share