Merge pull request #644 from kencoken/master
Added method to SDWebImageManager to check if an image exists in either ...
This commit is contained in:
commit
a0bc09df7d
|
|
@ -216,6 +216,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
|
|||
/**
|
||||
* Check if image has already been cached
|
||||
*/
|
||||
- (BOOL)cachedImageExistsForURL:(NSURL *)url;
|
||||
- (BOOL)diskImageExistsForURL:(NSURL *)url;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -60,6 +60,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL)cachedImageExistsForURL:(NSURL *)url {
|
||||
NSString *key = [self cacheKeyForURL:url];
|
||||
if ([self.imageCache imageFromMemoryCacheForKey:key] != nil) return YES;
|
||||
return [self.imageCache diskImageExistsWithKey:key];
|
||||
}
|
||||
|
||||
- (BOOL)diskImageExistsForURL:(NSURL *)url {
|
||||
NSString *key = [self cacheKeyForURL:url];
|
||||
return [self.imageCache diskImageExistsWithKey:key];
|
||||
|
|
|
|||
Loading…
Reference in New Issue