I am rotating a CALayer and trying to stop it at its final position after animation is completed.
But after animation completes it resets to its initial position.
(xcode docs explicitly say that the animation will not update the value of the property.)
any suggestions how to achieve this.
Without using the
removedOnCompletion
You can try this technique:
You can simply set the key of
CABasicAnimation
toposition
when you add it to the layer. By doing this, it will override implicit animation done on the position for the current pass in the run loop.You can have more information on 2011 Apple WWDC Video Session 421 - Core Animation Essentials (middle of the video)