0

I'm trying to create a sort of progress bar class that fills along a UIBezierPath as it progresses. I need to stroke a UIBezierPath with a controlled animation.

I think I could implement this if I could truncate the path to a precise portion of its original length. Is this possible? Is there another method I can use to precisely control the animated stroking of a path?

I've seen this question, but the answer seems to address finding the points at the beginning and end of each element. I'd need to get a list of points at a pixel-by-pixel level for a list of points to be a viable solution.

Community
  • 1
  • 1
Luke Taylor
  • 8,631
  • 8
  • 54
  • 92

1 Answers1

0

I believe I'm looking for the strokeEnd property.

Luke Taylor
  • 8,631
  • 8
  • 54
  • 92
  • 1
    Yup—make a CAShapeLayer, give it your bezier path’s `CGPath`, set a stroke color, and adjust `strokeEnd` from 0 to 1. – Noah Witherspoon Jul 08 '16 at 23:44
  • Ok, thanks a lot. I actually know nothing about iOS, I'm struggling through iOS by trying to extend the `ui` wrapper that comes with the Pythonista app. I'm trying to figure out which already-implemented Python classes are equivalent to which iOS things, and I'm kind of struggling. I think I'm getting it, though :D – Luke Taylor Jul 08 '16 at 23:46