@interface ViewController ()
@property(nonatomic,strong)UIImageView* iv;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
_iv = [[UIImageView alloc]initWithFrame:CGRectMake(20, 200, 200, 200)];
_iv.image =[UIImage imageNamed:@"Unlock_DotLock1_Selected-1"];
_iv.contentMode = UIViewContentModeScaleAspectFit;
[self.view addSubview:_iv];
```
UIImage *img1 = [UIImage imageNamed:@"1"];
UIImage *img2 = [UIImage imageNamed:@"2"];
UIImage *img3 = [UIImage imageNamed:@"3"];
UIImage *img4 = [UIImage imageNamed:@"4"];
_iv.animationImages = @[img1,img2,img3,img4];
_iv.animationDuration = 0.5;
_iv.animationRepeatCount = 10000;
[_iv startAnimating];
}
“`