Merge pull request #1218 from mythodeia/master
progress callbacks now report on main thread
This commit is contained in:
commit
a45c722fc8
|
@ -142,8 +142,10 @@ static NSString *const kCompletedCallbackKey = @"completed";
|
|||
callbacksForURL = [sself.URLCallbacks[url] copy];
|
||||
});
|
||||
for (NSDictionary *callbacks in callbacksForURL) {
|
||||
SDWebImageDownloaderProgressBlock callback = callbacks[kProgressCallbackKey];
|
||||
if (callback) callback(receivedSize, expectedSize);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
SDWebImageDownloaderProgressBlock callback = callbacks[kProgressCallbackKey];
|
||||
if (callback) callback(receivedSize, expectedSize);
|
||||
});
|
||||
}
|
||||
}
|
||||
completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {
|
||||
|
|
Loading…
Reference in New Issue