核心动画
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CAKeyframeAnimation *anim1 = [CAKeyframeAnimation animationWithKeyPath:@"position"];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(50, 50, 250, 250)];
anim1.path = path.CGPath;
CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
anim2.toValue = @(2 * M_PI);
CAKeyframeAnimation *anim3 = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
anim3.values = @[@1, @0.1, @1.2];
CAAnimationGroup *group = [[CAAnimationGroup alloc] init];
group.animations = @[anim1, anim2, anim3];
group.duration = 2.0;
group.repeatCount = MAXFLOAT;
[self.myView.layer addAnimation:group forKey:nil];
}