Jiffy

Overview

Jiffy makes working with animated images (.gif / .apng) a breeze. While there are a lot of libraries out there that accomplish something similar, most of them are usually plagued with un-needed features and performance issues. Jiffy aims to be a small & simple animated image library with little-to-no performance overhead.

This library is named after the absurd way my co-worker tries to pronounce "Gif". It’s not a jar of peanut-butter, it’s an animated image.

Installation

CocoaPods

Jiffy is integrated with CocoaPods!

Add the following to your Podfile:

use_frameworks!
pod 'Jiffy'

In your project directory, run pod install

Import the Jiffy module wherever you need it

Profit

Manually

You can also manually add the source files to your project.

Clone this git repo

Add all the Swift files in the Jiffy/ subdirectory to your project

Profit

Jiffy

At it’s core, Jiffy is just a set of extensions over UIImage & UIImageView. This makes working with animated images familiar and easy.

That’s it. You now have a beautiful animated image looping in your view! If you want to stop your animated image, just call imageView.stopAnimatedImage(). Naturally, a call to imageView.playAnimatedImage() will start your animation again.

You can also tell an existing UIImageView to start playing an animated image. This is useful when you want to layout your views with Storyboards.