Authored by derpoliuk

Adds -[SDWebImageManager saveImageToCache:forURL:] method

... ... @@ -188,6 +188,16 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
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
*/
- (void)cancelAll;
... ...
... ... @@ -215,6 +215,13 @@
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 {
@synchronized (self.runningOperations) {
[self.runningOperations makeObjectsPerformSelector:@selector(cancel)];
... ...