Kingfisher v5.0.0 Release Notes

Release Date: 2018-12-08 // over 5 years ago
  • โž• Add

    • โž• Add Result type to Kingfisher. Now all callbacks in Kingfisher are using Result instead of tuples. This is more future-friendly and provides a modern way to make error handling better.
    • ๐Ÿ‘‰ Make KingfisherError much more elaborate and accurate. Instead of simply provides the error code, now KingfisherError contains error reason and necessary associated values. It will help to understand and track the errors easier.
    • ๐Ÿ‘ Better cache management by separating memory cache and disk cache to their own storages. Now you can use MemoryStorage and DiskStorage as the ImageCache backend.
    • Image cache of memory storage would be purged automatically in a certain time interval. This reduce memory pressure for other parts of your app.
    • The ImageCache is rewritten from scratch, to get benefit from new created MemoryStorage and DiskStorage. At the same time, this hybrid cache abstract keeps most API compatibility from the earlier versions.
    • Now the ImageCache can receive only raw Data object and cache it as needed.
    • ๐ŸŽ A KingfisherParsedOptionsInfo type to parse KingfisherOptionsInfoItems in related API. This improves reusability and performance when handling options in Kingfisher.
    • An option to specify whether an image should also prefetched to memory cache or not.
    • ๐Ÿ”€ An option to make the disk file loading synchronously instead of in its own I/O queue.
    • Options to specify cache expiration for either memory cache or disk cache. This gives you a chance to control cache lifetime in a per-task grain size.
    • โž• Add a default maximum size for memory cache. Now only at most 25% of your device memory will be used to kept images in memory. You can also change this value if needed.
    • An option to specify a processing queue for image processors. This gives your flexibility if you want to use main queue or if you want to dispatch the processing to a different queue.
    • A DownsamplingImageProcessor for downsampling an image to a given size before loading it to memory.
    • โž• Add ImageDataProvider protocol to make it possible to provide image data locally instead of downloading from network. Several concrete types are provided to load images from data format. Use LocalFileImageDataProvider to load an image from a local disk path, Base64ImageDataProvider to load image from a Base64 string representation and RawImageDataProvider to provide a raw Data object.
    • ๐Ÿ‘ A general Source protocol to define from where the image should be loaded. Currently, we support to load an image from ImageDataProvider or from network now.

    ๐Ÿ›  Fix

    • Now CommonCrypto from system is used to calculate file name from cache key, instead of using a customized hash algorithm.
    • An issue which causes ImageDownloader crashing when a lot of downloading tasks running at the same time.
    • ๐Ÿ’ป All operations like image pretching and data receiving should now be performed in non-UI threads correctly.
    • ๐ŸŽ Now KingfisherCompatible uses struct for kf namespacing for better performance.