Skip to content

Commit 1872fed

Browse files
author
Olivier Poitrey
committed
Merge pull request SDWebImage#562 from mknippen/master
added currentDownload Count, to allow someone to see how many operations are left.
2 parents 75a76d9 + d0f8571 commit 1872fed

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ - (void)setMaxConcurrentDownloads:(NSInteger)maxConcurrentDownloads
104104
_downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads;
105105
}
106106

107+
- (NSUInteger)currentDownloadCount
108+
{
109+
return _downloadQueue.operationCount;
110+
}
111+
107112
- (NSInteger)maxConcurrentDownloads
108113
{
109114
return _downloadQueue.maxConcurrentOperationCount;

0 commit comments

Comments
 (0)