is there a nice way to calculate the position of a path (CGPath or UIBezierPath) at a given time (from 0 to 1)?
Using CAShapeLayer for example, one can create an ani
If you keep records of all your points from the beginning, you can calculate the distance between them.
When you want to know at a given time which of those points are being animated on the screen, you can do this:
first, get the current value of the strokeEnd (it's between 0 and 1) like this:
CAShapeLayer *presentationLayer = (CAShapeLayer*)[_pathLayer presentationLayer];
CGFloat strokeValue = [[presentationLayer valueForKey:@"strokeEnd"] floatValue];
then calculate the distance you already drew by now:
CGFloat doneDistance = _allTheDistance * strokeValue;
after this, you have to iterate all your points and calculate the distance between them till you get that doneDistance
This won't tell you exactly where on screen the path is, but the current point that is animated. Maybe it will help someone.