Skip to content

Instantly share code, notes, and snippets.

@sdpjswl
Created March 12, 2015 05:29
Show Gist options
  • Save sdpjswl/2a672931013680113553 to your computer and use it in GitHub Desktop.
Save sdpjswl/2a672931013680113553 to your computer and use it in GitHub Desktop.
How to outlet constraints and animate constraint changes
[self.view layoutIfNeeded]; // always call on self.view
_constraintObject.constant = 44; // change the constraint value
[UIView animateWithDuration:0.25
animations:^{
[self.view layoutIfNeeded]; // call again to update the layout
}];
sources:
http://stackoverflow.com/questions/12622424/how-do-i-animate-constraint-changes
http://stackoverflow.com/questions/22086054/unable-to-make-outlet-connection-to-a-constraint-in-ib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment