I'm having some problems getting CoreAnimation to perform multiple animations in succession on the iPhone simulator. I have many layers in my application that I animate – these layers are all sublayers of the layer associated with a UIView in my application. After I animate the first sublayer's position (using explicit animation - CAKeyFrameAnimation), I do the following in the animationDidStop delegate method:
- I remove the layer from its superlayer
- I start a CATransaction to animate 2 other sublayers' positions simultaneously - these layers are also animated explicitly with individual CAKeyframeAnimations added to the respective layers.
- I then reuse the 1st layer with different contents and add that back to the superlayer in a separate position (intentionally not animated).
When I run my application, I see the first animation occur, the layer then gets removed, and the layer gets added back with new contents in the new position, but I never see the animation of the 2 layers in step 2. Interestingly, I do get animationDidStop calls for each of the 2 layers animating in the transaction. Since I get these calls it would appear the animations are occurring, but the animations do not appear on screen. I also tried removing the transaction in case I didn't have that set up correctly and am seeing the same results.
Is it possible to link together multiple animations in this manner?
Any insights or suggestions are greatly appreciated. Thanks in advance for your help.