mirror of
https://github.com/zhigang1992/PINRemoteImage.git
synced 2026-04-29 04:35:15 +08:00
Return image result type of 'None' if no image is downloaded
Previously the resultType was being returned PINRemoteImageResultTypeDownload even when the download failed. Now, we check to see if the image has been set and if it not then we return PINRemoteImageResultTypeNone.
This commit is contained in:
@@ -54,11 +54,17 @@
|
||||
PINLog(@"calling completion for UUID: %@ key: %@", UUID, strongSelf.key);
|
||||
dispatch_async(queue, ^
|
||||
{
|
||||
PINRemoteImageResultType result;
|
||||
if (image || animatedImage) {
|
||||
result = cached ? PINRemoteImageResultTypeCache : PINRemoteImageResultTypeDownload;
|
||||
} else {
|
||||
result = PINRemoteImageResultTypeNone;
|
||||
}
|
||||
callback.completionBlock([PINRemoteImageManagerResult imageResultWithImage:image
|
||||
animatedImage:animatedImage
|
||||
requestLength:CACurrentMediaTime() - callback.requestTime
|
||||
error:error
|
||||
resultType:cached?PINRemoteImageResultTypeCache:PINRemoteImageResultTypeDownload
|
||||
resultType:result
|
||||
UUID:UUID]);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user