Why is -animateWithDuration:delay:options:animations:completion: blocking the UI?

后端 未结 2 653
醉酒成梦
醉酒成梦 2021-01-18 03:36

I always thought that Core Animation performs animations on the background. When I run this code, my UI interactions are blocked until the animation finishes:



        
2条回答
  •  天涯浪人
    2021-01-18 04:00

    Documentation is your friend :)

    UIView Class Reference

    Under animateWithDuration:animations:

    "During an animation, user interactions are temporarily disabled for the views being animated. (Prior to iOS 5, user interactions are disabled for the entire application.)"

    And of course, for all views under the animated view.

提交回复
热议问题