I use the following code to animate a
CAShapeLayer’s path property.
If the two paths have a different number of control points or segments the results are undefined. - docs
If you delay the start of an animation, you might also want to set the fillMode property to
kCAFillModeBackwards. This fill mode causes the layer to display the animation’s start value, even if the layer object in the layer tree contains a different value. Without this fill mode, you would see a jump to the final value before the animation starts executing. - docs