ios隐性动画--- 加贝塞尔曲线运动

------------------------------------凌乱的分割线----------------------------------------

加贝塞尔曲线运动

CAKeyframeAnimation *positionAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];

positionAnimation.calculationMode = kCAAnimationPaced;
positionAnimation.fillMode = kCAFillModeForwards;
positionAnimation.removedOnCompletion = NO;
positionAnimation.repeatCount = 0;

CGMutablePathRef curvedPath = CGPathCreateMutable();
UIBezierPath *cutePath = [UIBezierPath bezierPath];
[cutePath moveToPoint:fpoint];
[cutePath addCurveToPoint:tpoint controlPoint1:point1 controlPoint2:point2]; //贝塞尔曲线
CGPathAddPath(curvedPath, 0, cutePath.CGPath);
positionAnimation.path = curvedPath;
CGPathRelease(curvedPath);

你可能感兴趣的:(ios隐性动画--- 加贝塞尔曲线运动)