0
votes

I have an animation that runs for several seconds in response to a tap gesture. While the animation is running, the UITapGestureRecognizer won't respond to additional taps. Once the animation completes, the recognizer works again.

I've tried running the animation inside

dispatch_async(dispatch_get_main_queue(), etc.

but additional taps are still blocked. If I try running the animation inside

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), etc.

then the animation doesn't show at all. I vaguely remember reading somewhere that animations have to be run on the main thread.

Any suggestions for running an animation that doesn't block subsequent gestures? Thanks.

1

1 Answers

0
votes

If you're using UIView animation blocks, you can use +animateWithDuration:delay:options:animations:completion: with the UIViewAnimationOptionAllowUserInteraction option.

Also, you're correct that animations must be performed on the main thread.