CocoaPods trunk is moving to be read-only. Read more on the blog, there are 11 months to go.
| TestsTested | ✗ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Jun 2017 |
| SwiftSwift Version | 3.0 |
| SPMSupports SPM | ✗ |
Maintained by Robert D. Mogos.
RMImageLoader is a library for background image-loading.
RMImageLoader allows you to download asynchronously images. In order to improve and avoid the number of connection, each image that it is being downloaded can have multiple subscribers. A subscriber is an AnyObject that is interested in the image. This way, you avoid downloading the same image several times. The download can’t be canceled unless all the subcribers decided not to download it anymore. Otherwise, any subscriber that cancels it, will just be ignored when the download is ready.
import RMImageLoaderRMImageLoader.default.loadImage(url: yourUrl, subscriber: imageView, success: { image in
imageView.image = image
}, failure: { _ in
print("ouch")
})or even faster
imageView.load(url: yourUrl)imageView.cancel(url: yourUrl)or
RMImageLoader.default.cancel(url: yourUrl, forSubscriber: imageView)The default configuration can be used which will use the Retriever to download the images but any can be initialized with any class that implements the Retrieve protocol
The default implementation is using an NSCache to store the processed data:
You can inject your own URLSessionConfiguration