-3

The gif below was pulled from Two Dots, an iOS app. If my app is not a game, and I'm using standard UIViews, what is the best way to achieve similar effects in a performance-optimized manner.

I'm specifically referring to the lines shooting out between the circles.

enter image description here

rmaddy
  • 314,917
  • 42
  • 532
  • 579
jitsvm
  • 27
  • 1
  • 5

1 Answers1

0

A broad question prompts an unspecific answer: check out CAShapeLayer — its strokeStart and strokeEnd are animatable. So you can set the whole line as the shape, then get Core Animation to animate which segment is displayed.

Tommy
  • 99,986
  • 12
  • 185
  • 204
  • Can I just access/modify these properties on a UIView? – jitsvm Jan 09 '15 at 03:32
  • As per the JaredH comment; `CALayer`s are Objective-C so not low level in most senses, but sit below `UIView`s. They're one step down on the graphics stack. You can create a custom view that just holds a particular kind of layer or just use the layers directly as per the example he links to. – Tommy Jan 09 '15 at 03:55