Description
Gifu is a Swift library that adds protocol-based, performance-aware animated GIF support to UIKit. You can use its built-in GIFImageView subclass, or make your own view class conform to the GIFAnimatable protocol to get the same features with more flexibility. The protocol extensions expose the library's API with very little boilerplate, and the README says that any UIView subclass can conform, while a UIImageView subclass keeps features such as intrinsic content size. The work is done by an Animator class with a FrameStore that keeps only a limited number of frames in memory. It loads the current frame, buffers the next few frames and frees the rest, so large GIFs use far less memory than decoding every frame at once. The protocol gives you methods to prepare and start an animation from a named GIF or from data, stop it, inspect the frame count and the active frame, reset it for reuse and free resources. The README shows how classes that cannot inherit from the library can conform by using associated objects. The library is installed with Swift Package Manager, and the repository includes a demo app. Gifu is open source on GitHub under kaishin/Gifu.…
Highlights
- Animated GIF support for UIKit in Swift
- Buffers frames to keep memory use low
- GIFAnimatable protocol for any view class
- Built-in GIFImageView subclass
- Installs with Swift Package Manager
Ratings & Reviews
No ratings yet
Be the first to rate Gifu.
People also visit
Gifu FAQ
What is Gifu?
A Swift library that adds animated GIF support to UIKit views, with a focus on performance.
Is it free?
The project is public on GitHub. The README does not mention a price.
How do I install it?
Add it to your Package.swift file with Swift Package Manager.
Do I have to subclass a specific view?
No. You can use the built-in GIFImageView, or make your own view conform to the GIFAnimatable protocol.
How does it save memory?
Its frame store keeps only a few frames in memory, loading the current one, buffering the next ones and freeing the others.
Can I stop and restart an animation?
Yes. The protocol exposes start and stop methods, and you can inspect the frame count and the active frame.
Where is the source?
On GitHub at kaishin/Gifu.
What are the best Gifu alternatives?
Popular alternatives to Gifu include Agrume, gif.js and APNG4Android. See all Gifu alternatives



