From b4fb940cbcf9288a6ee6fd460e666f4ac4023f08 Mon Sep 17 00:00:00 2001 From: Matej Bukovinski Date: Mon, 10 Dec 2012 12:40:05 +0100 Subject: [PATCH] Send out progress callbacks sooner. - as soon as the NSURLConnection gets initialized - helps to allocate and show progress indication sooner and prevent large delays without progress indication (for example when the server takes long to respond) - estimated size is always 0 at this point, clients can use this to decide if they want to handle this callback or skip it --- SDWebImage/SDWebImageDownloaderOperation.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index f12ba1be..65f9af24 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -71,6 +71,10 @@ if (self.connection) { + if (self.progressBlock) + { + self.progressBlock(0, 0); + } [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStartNotification object:self]; } else