SDWebImageManagerDelegate Protocol Reference
| Conforms to | NSObject |
| Declared in | SDWebImageManager.h |
Overview
Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed. The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation. This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics. If a cached image is refreshed, the completion block is called once with the cached image and again with the final image.
Use this flag only if you can’t make your URLs static with embeded cache busting parameter.
Tasks
-
– imageManager:shouldDownloadImageForURL:Controls which image should be downloaded when the image is not found in the cache.
-
– imageManager:transformDownloadedImage:withURL:Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. NOTE: This method is called from a global queue in order to not to block the main thread.
Instance Methods
imageManager:shouldDownloadImageForURL:
Controls which image should be downloaded when the image is not found in the cache.
- (BOOL)imageManager:(SDWebImageManager *)imageManager shouldDownloadImageForURL:(NSURL *)imageURLParameters
- imageManager
The current
SDWebImageManager
- imageURL
The url of the image to be downloaded
Return Value
Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied.
Discussion
Controls which image should be downloaded when the image is not found in the cache.
Declared In
SDWebImageManager.himageManager:transformDownloadedImage:withURL:
Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. NOTE: This method is called from a global queue in order to not to block the main thread.
- (UIImage *)imageManager:(SDWebImageManager *)imageManager transformDownloadedImage:(UIImage *)image withURL:(NSURL *)imageURLParameters
- imageManager
The current
SDWebImageManager
- image
The image to transform
- imageURL
The url of the image to transform
Return Value
The transformed image object.
Discussion
Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. NOTE: This method is called from a global queue in order to not to block the main thread.
Declared In
SDWebImageManager.h