动画(两个图片切换)

简单的动画

#import "SZMLuckyController.h"

@interface SZMLuckyController ()
@property (weak, nonatomic) IBOutlet UIImageView *luckyLight;

@end

@implementation SZMLuckyController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.luckyLight.animationImages = @[
                                        [UIImage imageNamed:@"lucky_entry_light0"],
                                        [UIImage imageNamed:@"lucky_entry_light1"]
                                        ];
//切换间隔时间 self.luckyLight.animationDuration
= 0.5;
//重复次数(0为一直重复) self.luckyLight.animationRepeatCount
= 0; //启动动画 [self.luckyLight startAnimating]; }
原文地址:https://www.cnblogs.com/ZMiOS/p/5035293.html