iOS 的高性能 GIF 动画引擎:FLAnimatedImage

jopen 9年前

FLAnimatedImage是一个用于iOS的高性能GIF动画引擎

  • 同时播放多个GIF格式与播放速度堪比桌面浏览器
  • Honors variable frame delays
  • 在内存压力下表现正常
  • 循环播放过程中消除了延迟或阻止
  • Interprets the frame delays of fast GIFs the same way modern browsers do

It's a well-tested component that powers all GIFs in Flipboard. To understand its behavior it comes with an interactive demo:

Flipboard playing multiple GIFs

Who is this for?

  • Apps that don't support animated GIFs yet
  • Apps that already support animated GIFs but want a higher performance solution
  • People who want to tinker with the code (the corresponding blog post is a great place to start; also see the To Do section below)
FLAnimatedImage *image = [FLAnimatedImage animatedImageWithGIFData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://raphaelschaad.com/static/nyan.gif"]]];  FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];  imageView.animatedImage = image;  imageView.frame = CGRectMake(0.0, 0.0, 100.0, 100.0);  [self.view addSubview:imageView];

项目主页:http://www.open-open.com/lib/view/home/1425962219435