I have an image downloader class that is equipped with NSURL downloads and an image from the Internet and runs a completion block. The code is actually quite simple
- (void)downloadImageWithURL:(NSString *)URLString completion:(BELoadImageCompletionBlock)completion
{
dispatch_async(_queue, ^{
UIImage *image = nil;
NSURL *URL = [NSURL URLWithString:URLString];
if (URL) {
image = [UIImage imageWithData:[NSData dataWithContentsOfURL:URL]];
}
dispatch_async(dispatch_get_main_queue(), ^{
completion(image, URLString);
});
});
}
When i replace
dispatch_async(_queue, ^{
with comments
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
, ( , , ). , , , 50 , downloadImageWithURL: : , _queue, , , 85+ . , dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_HIGH, 0) 50 GCD ? , gcd , , , ?