Objective c 如何沿路径设置动画

Objective c 如何沿路径设置动画,objective-c,Objective C,如何沿路径设置UIImageView动画 有人知道有哪些教程介绍了这一点吗?CAKayframeAnimation可以这样做 CGMutablePathRef path = CGPathCreateMutable(); //your code to configure the path //configure the animation CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"po

如何沿路径设置UIImageView动画


有人知道有哪些教程介绍了这一点吗?

CAKayframeAnimation可以这样做

CGMutablePathRef path = CGPathCreateMutable();
//your code to configure the path

//configure the animation
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
[animation setPath:path];
[animation setDuration:3.0];
CGPathRelease(path);
[self.yourImageView.layer addAnimation:animation forKey:NULL];

你试过上网吗?请展示一些研究成果。欢迎来到StackOverflow!这里最好的问题是关于代码、您尝试了什么以及您做出了什么努力。做一些研究,然后问一个特定的问题。我想知道你将如何使用关键帧动画来实现这一点。h文件中是否需要任何东西关于动画没有任何内容,但你可以将imageView作为属性添加到ViewController中这是UIView子类吗?UIImageView,UIKit提供所需的核心动画?为了确保这不需要在UIView子类中。