Animate line drawing (Quartz 2D?)
With the new API, you can do this easily using the strokeEnd
CGPath property .
You can read more here: What's the easiest way to animate a string?
a source to share
There is no built-in way to do this. You will have to redraw the line again, interpolating between the start and end points, using a timer callback to invalidate the view and cause the redraw. Of course, a redraw would have to paint everything in the view area in order to redraw, which is potentially slow.
What I would do if I had a series of lines that I would like to draw over a period of time is to have two subheadings - they will cover the same area, and the top will have a transparent background. Make the top draw just the line that I am animating now, and when it ends draw its full length in the bottom view. Then re-animate the next line in the top view.
a source to share