Merge pull request #1321 from mythodeia/master
Added a new constructor to SDWebImagePrefetcher
This commit is contained in:
commit
2d748f1e2f
|
@ -70,6 +70,11 @@ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls,
|
|||
*/
|
||||
+ (SDWebImagePrefetcher *)sharedImagePrefetcher;
|
||||
|
||||
/**
|
||||
* Allows you to instantiate a prefetcher with any arbitrary image manager.
|
||||
*/
|
||||
- (id)initWithImageManager:(SDWebImageManager *)manager;
|
||||
|
||||
/**
|
||||
* Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
|
||||
* currently one image is downloaded at a time,
|
||||
|
|
|
@ -33,8 +33,12 @@
|
|||
}
|
||||
|
||||
- (id)init {
|
||||
return [self initWithImageManager:[SDWebImageManager new]];
|
||||
}
|
||||
|
||||
- (id)initWithImageManager:(SDWebImageManager *)manager {
|
||||
if ((self = [super init])) {
|
||||
_manager = [SDWebImageManager new];
|
||||
_manager = manager;
|
||||
_options = SDWebImageLowPriority;
|
||||
_prefetcherQueue = dispatch_get_main_queue();
|
||||
self.maxConcurrentDownloads = 3;
|
||||
|
|
Loading…
Reference in New Issue