pod 'FLAnimatedImage', '~> 1.0'
#import "ViewController.h"
#import "FLAnimatedImageView.h"
#import "FLAnimatedImage.h"
@interface ViewController ()
@end
// 显示GIF动画
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"gif"];
NSData *imageData = [NSData dataWithContentsOfFile:imagePath];
FLAnimatedImage *image = [FLAnimatedImage animatedImageWithGIFData:imageData];
FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];
imageView.animatedImage = image;
imageView.frame = CGRectMake(10.0, 100.0, 100.0, 100.0);
[self.view addSubview:imageView];
}
@end