Nuke-Gifu-Plugin icon indicating copy to clipboard operation
Nuke-Gifu-Plugin copied to clipboard

Gifu plugin for Nuke

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 nuke_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.

License

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