图层动画

CABasicAnimation* rotationAnimation; 
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ]; 
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 
rotationAnimation.duration = 2; 
rotationAnimation.RepeatCount = 1000;//你可以设置到最大的整数值 
rotationAnimation.cumulative = NO; 
rotationAnimation.removedOnCompletion = NO; 
rotationAnimation.fillMode = kCAFillModeForwards; 
[rotateView.layer addAnimation:rotationAnimation forKey:@"Rotation"];

你可能感兴趣的:(iOS动画)