iOS 简单的动画连接

CABasicAnimation *flip = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];


flip.toValue = [NSNumber numberWithDouble:-M_PI];


CABasicAnimation *scale= [CABasicAnimation animationWithKeyPath:@"transform.scale"];


scale.toValue = [NSNumber numberWithDouble:12];


scale.duration = 1.5;


scale.autoreverses = YES;



CAAnimationGroup *group = [CAAnimationGroup animation];


group.animations = [NSArray arrayWithObjects:flip, scale,scale,flip,nil];


group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];


group.duration = 6;


group.fillMode = kCAFillModeForwards;


group.removedOnCompletion = NO;


[self.view.layer addAnimation:group forKey:@"position"];

你可能感兴趣的:(ios,简单的动画连接)