Merge pull request #118 from jcole/master

Allows you to set SDWebImageOptions for SDWebImageOptions.  Defaults to SDWebImageLowPriority.
This commit is contained in:
Olivier Poitrey 2012-05-11 17:34:26 -07:00
commit 5aa5b46952
2 changed files with 8 additions and 1 deletions

View File

@ -26,6 +26,12 @@
*/
@property (nonatomic, assign) NSUInteger maxConcurrentDownloads;
/**
* SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.
*/
@property (nonatomic, assign) SDWebImageOptions options;
/**
* Return the global image prefetcher instance.
*/

View File

@ -26,6 +26,7 @@ static SDWebImagePrefetcher *instance;
{
instance = [[SDWebImagePrefetcher alloc] init];
instance.maxConcurrentDownloads = 3;
instance.options = (SDWebImageLowPriority);
}
return instance;
@ -35,7 +36,7 @@ static SDWebImagePrefetcher *instance;
{
if (index >= [self.prefetchURLs count]) return;
_requestedCount++;
[imageManager downloadWithURL:[self.prefetchURLs objectAtIndex:index] delegate:self options:SDWebImageLowPriority];
[imageManager downloadWithURL:[self.prefetchURLs objectAtIndex:index] delegate:self options:self.options];
}
- (void)reportStatus