Fix SDWebImagePrefetcher maxConcurrentDownloads property
This commit is contained in:
parent
44c6224763
commit
10c44577f6
|
@ -35,12 +35,21 @@
|
|||
if ((self = [super init]))
|
||||
{
|
||||
_manager = SDWebImageManager.new;
|
||||
_manager.imageDownloader.maxConcurrentDownloads = 3;
|
||||
_options = SDWebImageLowPriority;
|
||||
self.maxConcurrentDownloads = 3;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads
|
||||
{
|
||||
self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads;
|
||||
}
|
||||
|
||||
- (NSUInteger)maxConcurrentDownloads
|
||||
{
|
||||
return self.manager.imageDownloader.maxConcurrentDownloads;
|
||||
}
|
||||
|
||||
- (void)startPrefetchingAtIndex:(NSUInteger)index
|
||||
{
|
||||
|
@ -88,7 +97,7 @@
|
|||
|
||||
// Starts prefetching from the very first image on the list with the max allowed concurrency
|
||||
NSUInteger listCount = self.prefetchURLs.count;
|
||||
for (NSUInteger i = 0; i < self.manager.imageDownloader.maxConcurrentDownloads && self.requestedCount < listCount; i++)
|
||||
for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++)
|
||||
{
|
||||
[self startPrefetchingAtIndex:i];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue