#import <QuartzCore/QuartzCore.h>
[UIView beginAnimations:@"RotationAnimation" context:nil];
CABasicAnimation *fullRotationAnimation;
fullRotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotationAnimation .fromValue = [NSNumber numberWithFloat:0];
fullRotationAnimation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
fullRotationAnimation.duration = 2;
fullRotationAnimation.repeatCount = 1e100f;
[myImage.layer addAnimation:fullRotationAnimation forKey:@"360"];
[UIView commitAnimations];
source
share