I'm running an animation after a button touch. If the user touches the button before the current animation finishes I want the new animation to wait until the current animation finishes. How can I do so?
Nest it with the completion variation of UIView's animateWithDuration wrapper like so:
[UIView animateWithDuration:1.00 animations:^{
//animate first!
}
completion:^(BOOL finished) {
[UIView animateWithDuration:1.00 animations:^{
//animate the second time.
}];
}];
Or just set a single animation to continue from it's current state with this:
[UIView animateWithDuration:1.00
delay:0.00
options:UIViewAnimationOptionBeginFromCurrentState
animations:^{
//animate
}
completion:^(BOOL finished){
}];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With