Adds -[SDWebImageManager saveImageToCache:forURL:] method
This commit is contained in:
parent
8fe72023dc
commit
78a50d3929
|
@ -187,6 +187,16 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
|
||||||
progress:(SDWebImageDownloaderProgressBlock)progressBlock
|
progress:(SDWebImageDownloaderProgressBlock)progressBlock
|
||||||
completed:(SDWebImageCompletedWithFinishedBlock)completedBlock;
|
completed:(SDWebImageCompletedWithFinishedBlock)completedBlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves image to cache for given URL
|
||||||
|
*
|
||||||
|
* @param image The image to cache
|
||||||
|
* @param url The URL to the image
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
- (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel all current opreations
|
* Cancel all current opreations
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -215,6 +215,13 @@
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url {
|
||||||
|
if (image && url) {
|
||||||
|
NSString *key = [self cacheKeyForURL:url];
|
||||||
|
[self.imageCache storeImage:image forKey:key toDisk:YES];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)cancelAll {
|
- (void)cancelAll {
|
||||||
@synchronized (self.runningOperations) {
|
@synchronized (self.runningOperations) {
|
||||||
[self.runningOperations makeObjectsPerformSelector:@selector(cancel)];
|
[self.runningOperations makeObjectsPerformSelector:@selector(cancel)];
|
||||||
|
|
Loading…
Reference in New Issue