sync drawing an ever-increasing path

2012-10-23 Thread Roland King
I want to animate the drawing of CGPath in a UIView, so it looks as if it's being drawn. I have the UIView, I have the CGPath, I am able to split the CGPath at any point from 0 to 100% into that which should be drawn and that which shouldn't yet, that's all done, so I can, fairly efficiently,

Re: sync drawing an ever-increasing path

2012-10-23 Thread Roland King
hmm .. actually it looks like I can TOTALLY use CALayer for this. I need a better book, the one I have doesn't cover this. Hitting google. On 23 Oct, 2012, at 7:37 PM, Roland King r...@rols.org wrote: I want to animate the drawing of CGPath in a UIView, so it looks as if it's being drawn.

Re: sync drawing an ever-increasing path

2012-10-23 Thread David Duncan
On Oct 23, 2012, at 4:37 AM, Roland King r...@rols.org wrote: I want to animate the drawing of CGPath in a UIView, so it looks as if it's being drawn. I have the UIView, I have the CGPath, I am able to split the CGPath at any point from 0 to 100% into that which should be drawn and that

Re: sync drawing an ever-increasing path

2012-10-23 Thread David Rowland
This worked for me. When initializing your UIView, add an instance variable shapeLayer and do this, shapeLayer = [CAShapeLayer layer]; [[self layer] addSublayer:shapeLayer]; In drawRect, set up your path and do this, CABasicAnimation *pathAnimation = [CABasicAnimation

Re: sync drawing an ever-increasing path

2012-10-23 Thread David Duncan
On Oct 23, 2012, at 12:34 PM, David Rowland rowla...@sbcglobal.net wrote: This worked for me. When initializing your UIView, add an instance variable shapeLayer and do this, shapeLayer = [CAShapeLayer layer]; [[self layer] addSublayer:shapeLayer]; In drawRect, set up

Re: sync drawing an ever-increasing path

2012-10-23 Thread David Rowland
There are several paths to be animated. I want each to appear when the user does some action. It seemed the best to but them in a method called by drawRect and redraw the view when something changed. Why would the memory footprint be enlarged? thanks for pointing to didMoveToWindow. David

Re: sync drawing an ever-increasing path

2012-10-23 Thread David Duncan
On Oct 23, 2012, at 2:44 PM, David Rowland rowla...@sbcglobal.net wrote: There are several paths to be animated. I want each to appear when the user does some action. It seemed the best to but them in a method called by drawRect and redraw the view when something changed. Why would the

Re: sync drawing an ever-increasing path

2012-10-23 Thread Roland King
On 24 Oct, 2012, at 2:37 AM, David Duncan david.dun...@apple.com wrote: On Oct 23, 2012, at 4:37 AM, Roland King r...@rols.org wrote: I want to animate the drawing of CGPath in a UIView, so it looks as if it's being drawn. I have the UIView, I have the CGPath, I am able to split the