added currentDownload Count, to allow someone to see how many operations are left.

This commit is contained in:
Matthew Knippen 2013-11-26 16:54:59 -06:00
parent 75a76d983a
commit d020aea02f
2 changed files with 10 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,10 @@ static NSString *const kCompletedCallbackKey = @"completed";
_downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads;
}
- (NSUInteger)currentDownloadCount {
return _downloadQueue.operationCount;
}
- (NSInteger)maxConcurrentDownloads
{
return _downloadQueue.maxConcurrentOperationCount;