Skip to content
Gifu plugin for Nuke
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Demo
Nuke-Gifu-Plugin.xcodeproj Update copyright Apr 5, 2018
Source
Supporting Files
.gitignore
.swift-version
CHANGELOG.md
Cartfile
Cartfile.resolved
LICENSE
Nuke-Gifu-Plugin.podspec
README.md

README.md

Nuke Gifu Plugin

Gifu plugin for Nuke that allows you to load and display animated GIFs. You can see it for yourself in a demo, included in the project.

Deprecated: Gifu is still supported, but the plugin itself is no longer necessary - you can configure Nuke to work with Gifu with 8 lines of code.

Usage

All you need to do to enable GIF support is set isAnimatedImageDataEnabled to true and override display(image:) method on Gifu.GIFImageView:

ImagePipeline.Configuration.isAnimatedImageDataEnabled = true

extension Gifu.GIFImageView {
    public override func display(image: Image?) {
        prepareForReuse()
        if let data = image?.animatedImageData {
            animate(withGIFData: data)
        } else {
            self.image = image
        }
    }
}

After you do that, you can start using Gifu.GIFImageView:

let view = Gifu.GIFImageView()
Nuke.loadImage(with: URL(string: "http://.../cat.gif")!, into: view)

Installation

There is no installation required.

Requirements

  • iOS 9
  • Xcode 9.3
  • Swift 4.1

Dependencies

License

Nuke is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.