AFNetworking/AFNetworking — Issue #234: AFImageCache - Functionality to know if a image is cached?
Author: Torsph
Created: 2012-03-07 12:21:52+00:00
State: open

Hi!

Thank you for a great framework.

Im wondering if you will provide any functionality to know if a image is cached or not?

Im taking use of this when I'm loading images in a tableview. Then I won't start request before the tableview has stopped dragging or decelerating. However, if the image is already downloaded and cached it should it be shown.

Like something like this:
```
- (BOOL)setImageIfCachedWithURLRequest:(NSURLRequest *)urlRequest
{
UIImage *cachedImage = [[[self class] af_sharedImageCache] cachedImageForRequest:urlRequest];
if (cachedImage) {
self.image = cachedImage;
return YES;
}
return NO;
}
```
Thank you, in advance :)