mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-03-28 23:58:50 +08:00
@@ -234,11 +234,17 @@
|
||||
}
|
||||
};
|
||||
|
||||
[_cache fetchCachedImageWithURL:_URL
|
||||
callbackQueue:dispatch_get_main_queue()
|
||||
completion:cacheCompletion];
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
[_cache fetchCachedImageWithURL:_URL
|
||||
callbackQueue:dispatch_get_main_queue()
|
||||
completion:cacheCompletion];
|
||||
});
|
||||
} else {
|
||||
[self _downloadImageWithCompletion:finished];
|
||||
// NSURLSessionDownloadTask will do file I/O to create a temp directory. If called on the main thread this
|
||||
// will cause significant performance issues.
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
[self _downloadImageWithCompletion:finished];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user