Skip to content

Commit d020aea

Browse files
committed
added currentDownload Count, to allow someone to see how many operations are left.
1 parent 75a76d9 commit d020aea

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

SDWebImage/SDWebImageDownloader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data,
6262

6363
@property (assign, nonatomic) NSInteger maxConcurrentDownloads;
6464

65+
/**
66+
* Shows the current amount of downloads that still need to be downloaded
67+
*/
68+
69+
@property (readonly, nonatomic) NSUInteger currentDownloadCount;
70+
6571
/**
6672
* Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`.
6773
*/

SDWebImage/SDWebImageDownloader.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ - (void)setMaxConcurrentDownloads:(NSInteger)maxConcurrentDownloads
104104
_downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads;
105105
}
106106

107+
- (NSUInteger)currentDownloadCount {
108+
return _downloadQueue.operationCount;
109+
}
110+
107111
- (NSInteger)maxConcurrentDownloads
108112
{
109113
return _downloadQueue.maxConcurrentOperationCount;

0 commit comments

Comments
 (0)