Pg 337 problem with CABasicAnimation


The CABasicAnimations example code of pg 377 (fader and mover) is problematic when a layer is a sublayer to a view. The animation completes correctly, but the layer then immediately pops back to the original position. In other words, the view isn’t aware of the change in position caused by the animation of the sublayer when it re-displays. The setPosition animations of the previous chapter don’t have this problem.

Is there a simple way to have the end resulting position after an animation be the correct position of a layer for the parent view? Is there a simple way to notify the parent view that a layer has been moved?


Sorry… 'should have kept reading. Answer is on pg 385.


Glad you found the solution. Do you understand why the fix on page 385 works.