Renamed `SDImageCache` `queryDiskCacheForKey:done:` to `queryCacheOperationForKey:done:`
Showing
3 changed files
with
8 additions
and
5 deletions
@@ -132,11 +132,14 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot | @@ -132,11 +132,14 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot | ||
132 | - (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key; | 132 | - (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key; |
133 | 133 | ||
134 | /** | 134 | /** |
135 | - * Query the disk cache asynchronously. | 135 | + * Query the cache asynchronously and call the completion when done. |
136 | * | 136 | * |
137 | - * @param key The unique key used to store the wanted image | 137 | + * @param key The unique key used to store the wanted image |
138 | + * @param doneBlock The completion block | ||
139 | + * | ||
140 | + * @return a NSOperation instance containing the cache op | ||
138 | */ | 141 | */ |
139 | -- (nullable NSOperation *)queryDiskCacheForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock; | 142 | +- (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock; |
140 | 143 | ||
141 | /** | 144 | /** |
142 | * Query the memory cache synchronously. | 145 | * Query the memory cache synchronously. |
@@ -324,7 +324,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { | @@ -324,7 +324,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { | ||
324 | return SDScaledImageForKey(key, image); | 324 | return SDScaledImageForKey(key, image); |
325 | } | 325 | } |
326 | 326 | ||
327 | -- (nullable NSOperation *)queryDiskCacheForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock { | 327 | +- (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock { |
328 | if (!doneBlock) { | 328 | if (!doneBlock) { |
329 | return nil; | 329 | return nil; |
330 | } | 330 | } |
@@ -143,7 +143,7 @@ | @@ -143,7 +143,7 @@ | ||
143 | } | 143 | } |
144 | NSString *key = [self cacheKeyForURL:url]; | 144 | NSString *key = [self cacheKeyForURL:url]; |
145 | 145 | ||
146 | - operation.cacheOperation = [self.imageCache queryDiskCacheForKey:key done:^(UIImage *cachedImage, NSData *cachedData, SDImageCacheType cacheType) { | 146 | + operation.cacheOperation = [self.imageCache queryCacheOperationForKey:key done:^(UIImage *cachedImage, NSData *cachedData, SDImageCacheType cacheType) { |
147 | if (operation.isCancelled) { | 147 | if (operation.isCancelled) { |
148 | @synchronized (self.runningOperations) { | 148 | @synchronized (self.runningOperations) { |
149 | [self.runningOperations removeObject:operation]; | 149 | [self.runningOperations removeObject:operation]; |
-
Please register or login to post a comment