A lightweight generic cache for iOS and tvOS written in Swift, with specialized support for images.
HanekeSwift is a lightweight generic cache library for iOS and tvOS applications, written in Swift. It provides a simple API for caching various data types like images, JSON, strings, and custom objects, with automatic memory and disk management. It excels at handling images by offering zero-config UIImageView and UIButton extensions that automatically resize and cache images in the background, ensuring fast and responsive UIs in table views and collection views.
iOS and tvOS developers building applications that require efficient caching of images, JSON, or other data types, particularly those working with UITableView or UICollectionView who need smooth scrolling and responsive interfaces.
Developers choose HanekeSwift for its simplicity and powerful out-of-the-box features, such as automatic image resizing, two-level caching (memory and LRU disk), and asynchronous operations. Its extensible design allows custom formats, fetchers, and support for additional data types, making it versatile while keeping the API straightforward.
A lightweight generic cache for iOS written in Swift with extra love for images.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports multiple data types out-of-the-box including UIImage, NSData, JSON, and String, with extensibility for custom types via DataConvertible and DataRepresentable protocols, allowing versatile caching beyond images.
Provides UIImageView and UIButton extensions that automatically handle image loading, resizing, decompression, and caching in background threads, optimized for smooth scrolling in UITableView and UICollectionView without manual setup.
All disk access and network fetching are performed asynchronously in background threads, with thread-safe operations ensuring data integrity in multi-threaded environments, as highlighted in the features list.
Evicts cache on memory warnings and when disk capacity is reached using an LRU algorithm, reducing manual intervention for cache maintenance and preventing disk overflow.
The README explicitly states that HanekeSwift is in initial development and its public API should not be considered stable, posing a risk for production apps due to potential breaking changes without warning.
Restricted to iOS 8.0+ and tvOS 9.1+, with no support for macOS, watchOS, or cross-platform Swift projects, limiting its use in broader applications or modern Apple ecosystems.
Relies on completion blocks and older asynchronous patterns, lacking integration with Swift's modern concurrency features like async/await or Combine, which can make it feel outdated in newer codebases.