1
votes

I'm trying to affect the timing of implicit CALayer animations using the CAMediaTiming protocol implemented by CALayer.

So far, it seems I have to do

[CATransaction begin];
[CATransaction setAnimationDuration:d];
layer.frame = newFrame;
[CATransaction commit];

layer.timeOffset = -1;

to create a 1 second delay for the implicit animation

Unfortunately what seems to happen here is very briefly the animation starts (the layer moves a tiny amount) and then pops back into place and waits for 1 second before starting the actual animation.

I believe that this is due to a delay in propagating the timeOffset information to the render tree. I've tried playing around with [CATransaction flush], but haven't found an arrangement that doesn't have the initial stutter.

Has anyone successfully used a CALayer's CAMediaTiming methods to change the timing of implicit animations?

1

1 Answers

1
votes

I found http://wangling.me/2011/06/time-warp-in-animation.html quite useful when using CAMediaTiming. Especially the explanations regarding timeOffset and beginTime might be of interest to you.