A high-performance, protocol-based animated GIF library for iOS, tvOS, and visionOS built with Swift.
Gifu is a Swift library that adds high-performance animated GIF support to iOS, tvOS, and visionOS applications. It solves the problem of memory-intensive GIF playback by using an intelligent frame buffering system, allowing smooth animations without excessive resource consumption. The library provides both a ready-to-use `GIFImageView` subclass and a flexible `GIFAnimatable` protocol for custom integration.
iOS, tvOS, and visionOS developers who need to display animated GIFs in their UIKit-based applications, particularly those working with custom views or requiring memory-efficient animation handling.
Developers choose Gifu for its protocol-oriented design that enables easy integration into existing view hierarchies, its performance-aware architecture that handles large GIFs efficiently, and its minimal boilerplate approach compared to lower-level animation solutions.
High-performance animated GIF support for iOS in Swift
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a FrameStore to buffer only a limited number of frames in memory, significantly reducing memory usage for large GIFs as illustrated in the README's diagram.
The GIFAnimatable protocol allows any UIView subclass to add GIF support with minimal boilerplate, enabling easy integration into existing view hierarchies.
Provides methods like prepareForAnimation, startAnimatingGIF, and stopAnimatingGIF, along with properties like frameCount for fine-grained management of GIF playback.
Seamlessly works with UIKit components including UIImageView and supports efficient memory handling in table and collection view cells via prepareForReuse.
Lacks native support for SwiftUI, forcing developers to use UIKit representables or custom wrappers, which adds complexity for modern Apple platforms.
Requires overriding the display method and managing the animator property for custom views, adding boilerplate and potential integration hurdles.
Focuses on the animation engine without providing ready-to-use UI components like playback controls, requiring additional development for user interactions.