mirror of
https://github.com/zhigang1992/PINRemoteImage.git
synced 2026-04-23 03:49:47 +08:00
Optionally pass full result to category implementor
This commit is contained in:
@@ -219,6 +219,11 @@
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
If you implement this method, it is called instead of pin_updateUIWithImage:animatedImage:
|
||||
*/
|
||||
- (void)pin_updateUIWithRemoteImageManagerResult:(PINRemoteImageManagerResult *)result;
|
||||
|
||||
- (PINRemoteImageManagerDownloadOptions)pin_defaultOptions;
|
||||
|
||||
@end
|
||||
|
||||
@@ -195,7 +195,13 @@
|
||||
return;
|
||||
}
|
||||
if (result.image) {
|
||||
[view pin_updateUIWithImage:result.image animatedImage:nil];
|
||||
if ([view respondsToSelector:@selector(pin_updateUIWithRemoteImageManagerResult:)]) {
|
||||
[view pin_updateUIWithRemoteImageManagerResult:result];
|
||||
}
|
||||
else {
|
||||
[view pin_updateUIWithImage:result.image animatedImage:nil];
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
if ([NSThread isMainThread]) {
|
||||
@@ -224,7 +230,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[view pin_updateUIWithImage:result.image animatedImage:result.animatedImage];
|
||||
if ([view respondsToSelector:@selector(pin_updateUIWithRemoteImageManagerResult:)]) {
|
||||
[view pin_updateUIWithRemoteImageManagerResult:result];
|
||||
}
|
||||
else {
|
||||
[view pin_updateUIWithImage:result.image animatedImage:result.animatedImage];
|
||||
}
|
||||
|
||||
if (completion) {
|
||||
completion(result);
|
||||
|
||||
Reference in New Issue
Block a user