Skip to content

Instantly share code, notes, and snippets.

@echoz
Created July 11, 2012 09:18
Show Gist options
  • Save echoz/3089230 to your computer and use it in GitHub Desktop.
Save echoz/3089230 to your computer and use it in GitHub Desktop.
do animation only if its supposed to be animated
-(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