Created
July 11, 2012 09:18
-
-
Save echoz/3089230 to your computer and use it in GitHub Desktop.
do animation only if its supposed to be animated
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 characters
-(void)doAnimated:(BOOL)animated animation:(void (^)(void))animation { | |
if (animated) { | |
[UIView animateWithDuration:0.33 | |
delay:0.0 | |
options:(UIViewAnimationCurveEaseInOut | UIViewAnimationOptionBeginFromCurrentState) | |
animations:animation | |
completion:nil]; | |
} else { | |
animation(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment