Kingfisher is a light-weight and pure Swift carried out library for downloading and caching photograph from the web. This venture is closely stimulated by means of the famous SDWebImage. And it affords you a threat to use pure Swift alternation in your subsequent app.
Features
- Everything in Kingfisher goes asynchronously, now not solely downloading, however additionally caching. That ability you will in no way fear about blockading your UI thread.
- Multiple-layer cache. Downloaded snap shots will be cached in each reminiscence and disk. So there is no want to down load once more and this ought to increase your app dramatically.
- Cache management. You can set the max period or dimension the cache should take. And the cache will additionally be cleaned robotically to stop taking too an awful lot resource.
- Modern framework. Kingfisher makes use of NSURLSession and the modern-day technological know-how of GCD, which makes it a robust and swift framework. It additionally gives you convenient APIs to use.
- Cancellable processing task. You can cancel the downloading or photograph retriving technique if it is no longer wanted anymore.
- Independent components. You can use the downloader or caching gadget separately. Or even create your personal cache primarily based on Kingfisher’s code.
- Options to decompress the photograph in historical past earlier than rendering it, which may want to enhance the UI performance.
- A class over UIImageView for putting photo from an URL directly.
Requirements
- iOS 8.0+
- Xcode 6.3
Installation
CocoaPods
CocoaPods is a dependency supervisor for Cocoa projects.
CocoaPods 0.36 provides helps for Swift and embedded frameworks. You can set up it with the following command:To combine Kingfisher into your Xcode undertaking the use of CocoaPods, specify it in your Podfile:
Then, run the following command:
Usage
You can locate the full API documentation at CocoaDocs.
UIImageView
Use Kingfisher in your venture is as convenient as a pie. You can use the UIImageView class and have faith Kingfisher to control downloading and cache images.
Basic
In your supply files, add the following code:
In most cases, Kingfisher is used in a reusable cell. Since the downloading manner is asynchronous, the beforehand photo will be remained in the course of the downloading of more recent one. The placeholder model of this API may want to help:
0 Comments