ios 贝塞尔动画

CGPoint fromPoint = self.imageView.center;
    
    //路径曲线
    UIBezierPath *movePath = [UIBezierPath bezierPath];
    [movePath moveToPoint:fromPoint];
    CGPoint toPoint = CGPointMake(300, 460);
    [movePath addQuadCurveToPoint:toPoint
                     controlPoint:CGPointMake(280,0)];
    //关键帧
    CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
    moveAnim.path = movePath.CGPath;
    moveAnim.removedOnCompletion = YES;
    [self.imageView.layer addAnimation:moveAnim forKey:nil];

posted on 2017-04-27 14:31  大木哥  阅读(176)  评论(0编辑  收藏  举报

导航