Merge pull request #562 from mknippen/master

added currentDownload Count, to allow someone to see how many operations are left.
This commit is contained in:
Olivier Poitrey 2013-11-26 19:34:49 -08:00
commit 1872fed8f0
2 changed files with 11 additions and 0 deletions

View File

@ -62,6 +62,12 @@ typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data,
@property (assign, nonatomic) NSInteger maxConcurrentDownloads;
/**
* Shows the current amount of downloads that still need to be downloaded
*/
@property (readonly, nonatomic) NSUInteger currentDownloadCount;
/**
* Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`.
*/

View File

@ -104,6 +104,11 @@ static NSString *const kCompletedCallbackKey = @"completed";
_downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads;
}
- (NSUInteger)currentDownloadCount
{
return _downloadQueue.operationCount;
}
- (NSInteger)maxConcurrentDownloads
{
return _downloadQueue.maxConcurrentOperationCount;