Question

I need to synchronize a path animation on two different layers (one is used as a mask for another layer, the other shows a graphical element that follows the path, i.e. draws the mask). If I just set them up identically, they never quite do the same thing. Currently, I am using a CAKeyframeAnimation with a path (for the graphical element) and a CABasicAnimation, where I animate "strokeEnd" of the same path from 0.0 to 1.0 (for the mask).

I guess an animation group does not work here, since that would mean I apply the group to the mask layer, which would hide the graphical element.

Was it helpful?

Solution

Have you set calculationMode = kCAAnimationPaced for the keyframe animation?

OTHER TIPS

Apple has informed me of a known bug in iOS7 where certain paths (such as elliptical paths) will not work well with respect to animating 2 different layers along the same path, e.g. strokeEnd of one layer, and position of another layer. Specifically, the 2 animations fall in and out of sync during the animation, and look sloppy. Apple also informed me there is no known workaround. I also filed a bug with Apple.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top