Objective c UIGestureRecognitor中的UIView动画

Objective c UIGestureRecognitor中的UIView动画,objective-c,uigesturerecognizer,uianimation,Objective C,Uigesturerecognizer,Uianimation,我有一个动画,它会在点击手势后运行几秒钟。动画运行时,UITapGestureRecognitor不会响应其他点击。动画完成后,识别器将再次工作 我试着在里面运行动画 dispatch_async(dispatch_get_main_queue(), etc. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), etc. 但更多的水龙头仍被堵塞。如果我试着在里面运行动画 dispat

我有一个动画,它会在点击手势后运行几秒钟。动画运行时,UITapGestureRecognitor不会响应其他点击。动画完成后,识别器将再次工作

我试着在里面运行动画

dispatch_async(dispatch_get_main_queue(), etc.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), etc.
但更多的水龙头仍被堵塞。如果我试着在里面运行动画

dispatch_async(dispatch_get_main_queue(), etc.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), etc.
那么动画就根本不显示了。我隐约记得在某个地方读到,动画必须在主线程上运行


对于运行不阻止后续手势的动画,有什么建议吗?谢谢。

如果您使用的是UIView动画块,您可以使用
+animateWithDuration:delay:options:animations:completion:
UIViewAnimationOptionAllowUserInteraction
选项


另外,动画必须在主线程上执行也是正确的。

谢谢,这正是我所需要的。我使用了更基本的animateWithDuration:方法。