Closed Ricardo1980 closed 10 years ago
Hi Ricardo,
You can set an initial delay by setting the beginTime
property in the animation object. Like so:
const NSTimeInterval delay = 1.0f;
animation.beginTime = CACurrentMediaTime() + delay;
Works perfectly! BTW, is there any easy way to launch a block when the animation (after the delay) is going to be started? I wanted to add a sound. Thanks.
You can do so by implementing the delegate method.
It works! Although this is strange, CAAnimationDelegate is not an actual protocol.
Hello! I'm using something like this: NSBKeyframeAnimation *animation2 = [NSBKeyframeAnimation animationWithKeyPath:@"transform.scale.y" duration:animationDuration startValue:0 endValue:1 function:NSBKeyframeAnimationFunctionEaseOutElastic];
to animate several views at once. My question is, how can I add a delay before the animation starts? I know UIView animation... has a method for that. Thanks a lot, very useful lib.