1.CAAnimationGroup,动画组.可以把让多个动画同时执行
@property (weak, nonatomic) IBOutlet UIImageView *icon;
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
CABasicAnimation *translation = [CABasicAnimation animation];
translation.duration = 0.5;
translation.keyPath = @"position";
translation.byValue = [NSValue valueWithCGPoint:CGPointMake(50, 100)];
CABasicAnimation *scale = [CABasicAnimation animation];
scale.duration = 1;
scale.keyPath = @"bounds";
scale.byValue =[NSValue valueWithCGRect:CGRectMake(0, 0, 200, 250)];
CAAnimationGroup *group = [CAAnimationGroup animation];
group.animations = @[translation,scale];
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards;
[self.icon.layer addAnimation:group forKey:nil];
}