CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
//顺时针效果,将fromValue和toValue的值互换,则为逆时针效果
animation.fromValue = [NSNumber numberWithFloat:0.f];
animation.toValue = [NSNumber numberWithFloat: M_PI *2];
animation.duration = 1;
animation.autoreverses = NO;
animation.fillMode =kCAFillModeForwards;
animation.repeatCount = MAXFLOAT;
[self.imageView.layer addAnimation:animation forKey:nil];
//顺时针效果,将fromValue和toValue的值互换,则为逆时针效果
animation.fromValue = [NSNumber numberWithFloat:0.f];
animation.toValue = [NSNumber numberWithFloat: M_PI *2];
animation.duration = 1;
animation.autoreverses = NO;
animation.fillMode =kCAFillModeForwards;
animation.repeatCount = MAXFLOAT;
[self.imageView.layer addAnimation:animation forKey:nil];