diff --git a/AFNetworking/UIImageView+AFNetworking.h b/AFNetworking/UIImageView+AFNetworking.h index 0b79875d0a..72a19eca02 100644 --- a/AFNetworking/UIImageView+AFNetworking.h +++ b/AFNetworking/UIImageView+AFNetworking.h @@ -39,6 +39,6 @@ placeholderImage:(UIImage *)placeholderImage imageSize:(CGSize)imageSize options:(AFImageRequestOptions)options - block:(void (^)(UIImage *image))block; + block:(void (^)(UIImage *image, BOOL cacheUsed))block; @end diff --git a/AFNetworking/UIImageView+AFNetworking.m b/AFNetworking/UIImageView+AFNetworking.m index 2fa7b96063..ebd483bd35 100644 --- a/AFNetworking/UIImageView+AFNetworking.m +++ b/AFNetworking/UIImageView+AFNetworking.m @@ -84,7 +84,7 @@ - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholderImage imageSize:(CGSize)imageSize options:(AFImageRequestOptions)options - block:(void (^)(UIImage *image))block + block:(void (^)(UIImage *image, BOOL cacheUsed))block { if (!url) { // stop loading image @@ -102,7 +102,7 @@ - (void)setImageWithURL:(NSURL *)url self.image = cachedImage; if (block) { - block(cachedImage); + block(cachedImage, YES); } } else { self.image = placeholderImage; @@ -110,7 +110,7 @@ - (void)setImageWithURL:(NSURL *)url self.imageRequestOperation = [AFImageRequestOperation operationWithRequest:request imageSize:imageSize options:options success:^(UIImage *image) { if (self.imageRequestOperation && ![self.imageRequestOperation isCancelled]) { if (block) { - block(image); + block(image, NO); } if ([[request URL] isEqual:[[self.imageRequestOperation request] URL]]) {