Skip to content

Instantly share code, notes, and snippets.

@convexstyle
Created September 6, 2013 03:42
Show Gist options
  • Save convexstyle/6459244 to your computer and use it in GitHub Desktop.
Save convexstyle/6459244 to your computer and use it in GitHub Desktop.
Immediately, cancel previous UIView animation.
- (void)startAnimation:(id)sender {
UIView animateWithDuration:2.0f delay:0.0f options:UIViewAnimationCurveEaseInOut animations:^{
_yourView.alpha = 0.0f;
} completion:^(BOOL finished) {
// Do something
}];
}
- (void)stopAnimation:(id)sender {
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView animateWithDuration:0.001 animations:^{
_yourView.alpha = 1;
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment