user1416564 user1416564 - 1 year ago 92
iOS Question

How can I animate the drawing of a complex line shape in objective-c

So say I wanted to animate drawing this shape:


Animate it something like the disney logo which seems to "write" the letters.

Ideally, I'd also like to have control over how fast it was drawn (maybe just easing), how would I go about getting that done? Specifically imagine if that link had a line of varying widths.

Not too familiar with drawing things in objective-c so perhaps someone can help point me in the right direction in terms of strategy.

Answer Source

Create a CAShapeLayer and set that shape as its path. Use a CABasicAnimation or a CAKeyframeAnimation to animate its strokeEnd property.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download