Reputation: 3136
I'm new to animation in iOS and there seems to be a lot of different ways to accomplish the same thing. I'm looking for a way to animate a flat line into a sine wave and back. What would be the best way to accomplish this? Also how would I go about adding an ease out or bounce effect?
Upvotes: 0
Views: 2139
Reputation: 119031
You can use a combination of CAShapeLayer
(with UIBezierPath
s to specify your line and sine wave line) and CABasicAnimation
to achieve this:
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];
animation.fromValue = (id)linePath;
animation.toValue = (id)sinePath;
[shapeLayer addAnimation:animation forKey:@"animatePath"];
Upvotes: 2