Optionally pass full result to category implementor

This commit is contained in:
Brian Dorfman
2015-10-14 12:23:50 -07:00
parent da495cd790
commit 4eaf1994e9
2 changed files with 18 additions and 2 deletions

View File

@@ -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

View File

@@ -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);