KingPolygon KingPolygon - 3 months ago 6x
iOS Question

iOS: Animating Multiple UIBezierPaths (One After the Other)?

I have an array of

. I loop through the array, create
, and then animate them. The problem is they all animate at the same time. I'd like to animate them one after the other, but I'm having trouble doing so.

I've tried calculating the beginTime by doing the following, but all it does is animate the first line, but not the rest of the lines (they just appear without an animation).

pathAnimation.beginTime = n * lineDuration;

pathAnimation.beginTime = n * lineDuration;

Well, that's your problem. That time is in the deep dark past.

You want a time in the future. Start by getting the CACurrentMediaTime() and now add the delay amount to that.