UIViewPropertyAnimator will lose animation block upon completion

I have a UIViewPropertyAnimator to control the current and firing loading view animation.

My boot view starts with a zero and scale alpha to scale it down. Then, in the animation block, I change those values ​​to the final values ​​(alpha of one and identity transformation). Then, in the process of being fired, I set the animator in reverse.

The actual animation works great, and if I cancel the animator (reject loading) in the middle of the animation, it works fine.

My problem is that if the animation ends the presentation and I try to cancel and start the animation again, I get the error:

*** Application terminated due to non-mapped exception "NSInternalInconsistencyException", Reason: "The animator (UIViewPropertyAnimator [inactive] breaker) must have at least one animation block to start!"

Do I have to reset the animation block every time the animator finishes?

+3


source to share





All Articles