Created
August 28, 2013 18:39
-
-
Save jamiepinkham/6369638 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
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