Merge pull request #1547 from maxoly/master

Fixed completion logic in MKAnnotationView+WebCache
This commit is contained in:
Konstantinos K 2016-05-04 20:04:15 +03:00
commit 19041b44c2
1 changed files with 11 additions and 2 deletions

View File

@ -51,8 +51,17 @@ static char imageURLKey;
dispatch_main_sync_safe(^{
__strong MKAnnotationView *sself = wself;
if (!sself) return;
if (image) {
sself.image = image;
if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) {
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) {
completedBlock(image, error, cacheType, url);