// 抛物线关键帧动画
CAKeyframeAnimation *keyframeAnimation=[CAKeyframeAnimation animationWithKeyPath:@"position"];
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, layer.position.x, layer.position.y);//移动到起始点
CGPathAddQuadCurveToPoint(path, NULL, 100, 100, endPosition.x, endPosition.y);
keyframeAnimation.path = path;
keyframeAnimation.delegate = self;
CGPathRelease(path);
keyframeAnimation.duration = kAnimationDuration;
[layer addAnimation:keyframeAnimation forKey:@"KCKeyframeAnimation_Position"];
CAKeyframeAnimation *keyframeAnimation=[CAKeyframeAnimation animationWithKeyPath:@"position"];
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, layer.position.x, layer.position.y);//移动到起始点
CGPathAddQuadCurveToPoint(path, NULL, 100, 100, endPosition.x, endPosition.y);
keyframeAnimation.path = path;
keyframeAnimation.delegate = self;
CGPathRelease(path);
keyframeAnimation.duration = kAnimationDuration;
[layer addAnimation:keyframeAnimation forKey:@"KCKeyframeAnimation_Position"];