ios UIView动画 图标抖动

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
- (IBAction)beginButn:(id)sender;
@end
- (IBAction)beginButn:(id)sender {
    //创建动画
    CAKeyframeAnimation * keyAnimaion = [CAKeyframeAnimation animation];
    keyAnimaion.keyPath = @"transform.rotation";
    keyAnimaion.values = @[@(-10 / 180.0 * M_PI),@(10 /180.0 * M_PI),@(-10/ 180.0 * M_PI)];//度数转弧度
    
    keyAnimaion.removedOnCompletion = NO;
    keyAnimaion.fillMode = kCAFillModeForwards;
    keyAnimaion.duration = 0.3;
    keyAnimaion.repeatCount = MAXFLOAT;
    [self.iconImageView.layer addAnimation:keyAnimaion forKey:nil];
    
}
ios UIView动画 图标抖动_第1张图片
222.gif

你可能感兴趣的:(ios UIView动画 图标抖动)