Need help with FLAnimatedImage?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

7.7K Stars 1.2K Forks MIT License 263 Commits 81 Opened issues


Performant animated GIF engine for iOS

Services available


Need anything else?

Contributors list

FLAnimatedImage is a performant animated GIF engine for iOS:

  • Plays multiple GIFs simultaneously with a playback speed comparable to desktop browsers
  • Honors variable frame delays
  • Behaves gracefully under memory pressure
  • Eliminates delays or blocking during the first playback loop
  • 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)

Installation & Usage

FLAnimatedImage is a well-encapsulated drop-in component. Simply replace your

instances with instances of
to get animated GIF support. There is no central cache or state to manage.

If using CocoaPods, the quickest way to try it out is to type this on the command line:

$ pod try FLAnimatedImage

To add it to your app, copy the two classes

into your Xcode project or add via CocoaPods by adding this to your Podfile:
pod 'FLAnimatedImage', '~> 1.0'

If using Carthage, add the following line into your

github "Flipboard/FLAnimatedImage"

If using Swift Package Manager, add the following to your

or add via XCode:
dependencies: [
    .package(url: "", .upToNextMajor(from: "1.0.16"))
targets: [
    .target(name: "TestProject", dependencies: ["FLAnimatedImage""])

In your code,

#import "FLAnimatedImage.h"
, create an image from an animated GIF, and setup the image view to display it:
FLAnimatedImage *image = [FLAnimatedImage animatedImageWithGIFData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@""]]];
FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];
imageView.animatedImage = image;
imageView.frame = CGRectMake(0.0, 0.0, 100.0, 100.0);
[self.view addSubview:imageView];

It's flexible to integrate in your custom image loading stack and backwards compatible to iOS 9.

It uses ARC and the Apple frameworks

, and

It is capable of fine-grained logging. A block can be set on

that's invoked when logging occurs with various log levels via the
method. For example:
// Set up FLAnimatedImage logging.
[FLAnimatedImage setLogBlock:^(NSString *logString, FLLogLevel logLevel) {
    // Using NSLog
    NSLog(@"%@", logString);

// ...or CocoaLumberjackLogger only logging warnings and errors
if (logLevel == FLLogLevelError) {
    DDLogError(@"%@", logString);
} else if (logLevel == FLLogLevelWarn) {
    DDLogWarn(@"%@", logString);

} logLevel:FLLogLevelWarn];

Since FLAnimatedImage is licensed under MIT, it's compatible with the terms of using it for any app on the App Store.

Release process

  1. Bump version in
    , update CHANGES, and commit.
  2. Tag commit with
    > git tag -a  -m ""
    > git push --tags
  3. Submit Podspec to Trunk with
    > pod trunk push FLAnimatedImage.podspec
    (ensure you're auth'ed). ## To Do
  4. Support other animated image formats such as APNG or WebP (WebP support implemented here)
  5. Integration into network libraries and image caches
  6. Investigate whether
    should become a
  7. Smarter buffering
  8. Bring demo app to iPhone

This code has successfully shipped to many people as is, but please do come with your questions, issues and pull requests!

Select apps using FLAnimatedImage


If you're using FLAnimatedImage in your app, please open a PR to add it to this list!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.