views:

33

answers:

0

tl;dr: How do I combine multiple UIView block-based animations into a single conceptual unit such that UIViewAnimationOptionBeginFromCurrentState works as expected?


I'm attempting to implement multi-step animations for re-orienting the screen on an iPhone. I've enabled orientation notifications and am using animatewithDuration: to execute the animations.

This works when the there is a single animation, e.g. rotation. If I start shaking the phone and create multiple orientation notifications before the last animation is complete, the animation will seamlessly work with the one in flight (because of UIViewAnimationOptionBeginFromCurrentState).

Here's my question. How do I do this for multi-step animations? Currently, I'm starting the "next step" by running it at the completion block of the last step. Unfortunately, multiple queued animations conflict with each other and I end up with an unpredictable mess. Can I put multiple transactions inside a "transaction"? Or do I need to go to a lower-level mechanism?