Haneke is a lightweight generic cache for iOS and tvOS written in Swift 4. It's designed to be super-simple to use. Haneke provides a memory and LRU disk cache for UIImage, NSData, JSON, String or any other type that can be read or written as data. Particularly, Haneke excels at working with images. It includes a zero-config image cache with automatic resizing. Everything is done in background, allowing for fast, responsive scrolling. Asking Haneke to load, resize, cache and display an appropriately sized image is very simple. Generic cache with out-of-the-box support for UIImage, NSData, JSON and String. Extensible by defining custom formats, supporting additional types or implementing custom fetchers. Automatic cache eviction on memory warnings or disk capacity reached. Zero-config UIImageView and UIButton extensions to use the cache, optimized for UITableView and UICollectionView cell reuse.
Features
- Comprehensive unit tests
- Thread-safe
- All disk access is performed in background
- Asynchronous fetching of original values from network or disk
- Second-level LRU disk cache using the file system
- First-level memory cache using NSCache