I need to animate the color of CATextLayer
, and the animation itself works:
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"foregroundColor"];
animation.duration = 1.0f;
animation.values = @[(id)([UIColor redColor].CGColor), (id)([UIColor blueColor].CGColor)];
[textLayer addAnimation:animation forKey:@"animation"];
However if I want to control the progress of animation by setting the layer's speed to 0, it doesn't work:
animation.speed = 0;
...
textLayer.timeOffset = 0.5f;
Is there anything I missed?
Thanks!