Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delay a CABasicAnimation?

I have a CABasicAnimation and want to start it after a delay. In UIKit I can specify delays. The CAMediaTiming protocol has a timeOffset property but I can't see an effect. My next try is to use GCD to delay it but it feels like overkill.

like image 739
openfrog Avatar asked Feb 27 '13 16:02

openfrog


1 Answers

Shouldn't you be using the [CAMediaTiming beginTime] property (reference)?

See Customizing the Timing of an Animation in the Core Animation Programming Guide.

CABasicAnimation *animation; animation.beginTime = CACurrentMediaTime() + 0.3; //0.3 seconds delay 
like image 158
trojanfoe Avatar answered Sep 30 '22 16:09

trojanfoe