Fixed completion logic in MKAnnotationView+WebCache
This commit is contained in:
parent
0df58e4995
commit
d2b648e8ff
|
@ -51,8 +51,17 @@ static char imageURLKey;
|
||||||
dispatch_main_sync_safe(^{
|
dispatch_main_sync_safe(^{
|
||||||
__strong MKAnnotationView *sself = wself;
|
__strong MKAnnotationView *sself = wself;
|
||||||
if (!sself) return;
|
if (!sself) return;
|
||||||
if (image) {
|
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) {
|
||||||
sself.image = image;
|
completedBlock(image, error, cacheType, url);
|
||||||
|
return;
|
||||||
|
} else if (image) {
|
||||||
|
wself.image = image;
|
||||||
|
[wself setNeedsLayout];
|
||||||
|
} else {
|
||||||
|
if ((options & SDWebImageDelayPlaceholder)) {
|
||||||
|
wself.image = placeholder;
|
||||||
|
[wself setNeedsLayout];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (completedBlock && finished) {
|
if (completedBlock && finished) {
|
||||||
completedBlock(image, error, cacheType, url);
|
completedBlock(image, error, cacheType, url);
|
||||||
|
|
Loading…
Reference in New Issue