Skip to content

Instantly share code, notes, and snippets.

@jamiepinkham
Created August 28, 2013 18:39
Show Gist options
  • Save jamiepinkham/6369638 to your computer and use it in GitHub Desktop.
Save jamiepinkham/6369638 to your computer and use it in GitHub Desktop.
NSDictionary *viewsDict = NSDictionaryOfVariableBindings(_viewToAnimate);
NSLayoutConstraint *animationConstraint = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(3)-[_viewToAnimate]" options:0 metrics:nil views:viewsDict][0];
[self.containerView removeConstraint:self.leftEdgeConstraint];
[self.containerView addConstraint:animationConstraint];
[UIView animateWithDuration:0.3 animations:^{
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
;
}];
*OR*
[self.buttonXAlignmentConstraint setConstant:115.0];
[UIView animateWithDuration:0.3 animations:^{
[self.view layoutIfNeeded];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment