wireapp/FLAnimatedImage

Name: FLAnimatedImage

Owner: Wire Swiss GmbH

Description: Performant animated GIF engine for iOS

Forked from: wearezeta/FLAnimatedImage

Created: 2016-07-14 14:42:18.0

Updated: 2017-10-19 12:29:04.0

Pushed: 2016-08-02 08:00:38.0

Homepage:

Size: 3995

Language: Objective-C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

FLAnimatedImage is a performant animated GIF engine for iOS:

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?
Installation & Usage

FLAnimatedImage is a well encapsulated drop-in component. Simply replace your UIImageView instances with instances of FLAnimatedImageView 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:

d try FLAnimatedImage

To add it to your app, copy the two classes FLAnimatedImage.h/.m and FLAnimatedImageView.h/.m into your Xcode project or add via CocoaPods by adding this to your Podfile:

'FLAnimatedImage', '~> 1.0'

If using Carthage, add following line into your Cartfile

ub "Flipboard/FLAnimatedImage"

In your code, #import "FLAnimatedImage.h", create an image from an animated GIF, and setup the image view to display it:

imatedImage *image = [FLAnimatedImage animatedImageWithGIFData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif"]]];
imatedImageView *imageView = [[FLAnimatedImageView alloc] init];
eView.animatedImage = image;
eView.frame = CGRectMake(0.0, 0.0, 100.0, 100.0);
f.view addSubview:imageView];

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

It uses ARC and the Apple frameworks QuartzCore, ImageIO, MobileCoreServices, and CoreGraphics.

It is capable of fine-grained logging. A block can be set on FLAnimatedImage that's invoked when logging occurs with various log levels via the +setLogBlock:logLevel: method. For example:

et up FLAnimatedImage logging.
nimatedImage 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);
}
gLevel:FLLogLevelWarn];

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

To Do

This 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!


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.