I'm pretty sure this is a rather simple and straightforward question for anyone that has ever tried this before , but i'm kind of a newbie to what you would call "advanced" animation.
I'm trying to create the following movement of an object by using CAKeyframeAnimation (with "position" key path)
http://www.sumopaint.com/files/images800/aeegfexznpohlehd.jpg
I've tried setting the path with a UIBezierPath but got confused and frustrated pretty fast with not finding the logic behind it :)
I'd love to hear if you have an opinion about this...
This is my base code (which might as well be written from scratch if a better idea would occur :P)
Also i wanted to fade out the object on completion. is there such a selector that performs on animation completion? (such as [UIView animateWithDuration] ) ?
UIBezierPath *thumbPath = [UIBezierPath bezierPath];
[thumbPath moveToPoint: P(99,270)];
[thumbPath addCurveToPoint:P(164,260) controlPoint1:P(164,280) controlPoint2:P(164,280)];
[thumbPath addCurveToPoint:P(164,260) controlPoint1:P(260,310) controlPoint2:P(260,310)];
CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
pathAnimation.path = thumbPath.CGPath;
pathAnimation.duration = 2.0;