Authored by Dmitry Fink

Add typedef for cache operation complete block

Makes it cleaner when users want to define the block independantly
@@ -24,6 +24,8 @@ typedef NS_ENUM(NSInteger, SDImageCacheType) { @@ -24,6 +24,8 @@ typedef NS_ENUM(NSInteger, SDImageCacheType) {
24 SDImageCacheTypeMemory 24 SDImageCacheTypeMemory
25 }; 25 };
26 26
  27 +typedef void(^SDWebImageQueryCompletedBlock)(UIImage *image, SDImageCacheType cacheType);
  28 +
27 /** 29 /**
28 * SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed 30 * SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed
29 * asynchronous so it doesn’t add unnecessary latency to the UI. 31 * asynchronous so it doesn’t add unnecessary latency to the UI.
@@ -102,7 +104,7 @@ typedef NS_ENUM(NSInteger, SDImageCacheType) { @@ -102,7 +104,7 @@ typedef NS_ENUM(NSInteger, SDImageCacheType) {
102 * 104 *
103 * @param key The unique key used to store the wanted image 105 * @param key The unique key used to store the wanted image
104 */ 106 */
105 -- (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(void (^)(UIImage *image, SDImageCacheType cacheType))doneBlock; 107 +- (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(SDWebImageQueryCompletedBlock)doneBlock;
106 108
107 /** 109 /**
108 * Query the memory cache synchronously. 110 * Query the memory cache synchronously.