I was reading about CATransactions and then thought this might help solve my problem.
This is what I wan't to do: I have 3 animations in the same layer, which all have their own duration. I create the animations using CAKeyframeAnimation with a CGMutablePathRef.
say for example:
- anim1 -> duration 5s
- anim2 -> 3s
- anim3 -> 10s
Now I want to serialize them sequentially. I tried to use CAAnimationGroup but the animations run concurrently. I read about CATransaction, is it a possible solution? Can you give me a little example?
thanks for help !
If by serialization you mean starting each animation after the previous one has finished, use the
beginTime
property (defined inCAMediaTiming
protocol). Note that its documentation is a little misleading. Here's an example: