How to specify an beginTime for an animation by using CFTimeInterval?

后端 未结 4 1336
情话喂你
情话喂你 2021-01-30 17:57

For my understanding, beginTime can be used to say \"hey, start at exactly 12:00 \'o clock\". But how would I tell this with an CFTimeInterval type? I thought that this one is n

4条回答
  •  情深已故
    2021-01-30 18:11

    What I missed in the docs: beginTime is in "core animation absolute time" so you've to get the current time and specify your offset from that:

    // Start in 5 seconds
    theAnimation.beginTime = CACurrentMediaTime() + 5;
    

提交回复
热议问题