Permalink
Browse files

Allows SDWebImagePrefetcher options to be set set. Defaults to SDWebI…

…mageLowPriority.
  • Loading branch information...
1 parent 102d7bd commit 35b6553eaccb311d1508aa963356b8a502597469 @jcole jcole committed May 11, 2012
Showing with 8 additions and 1 deletion.
  1. +6 −0 SDWebImage/SDWebImagePrefetcher.h
  2. +2 −1 SDWebImage/SDWebImagePrefetcher.m
View
6 SDWebImage/SDWebImagePrefetcher.h
@@ -27,6 +27,12 @@
@property (nonatomic, assign) NSUInteger maxConcurrentDownloads;
/**
+ * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.
+ */
+@property (nonatomic, assign) SDWebImageOptions options;
+
+
+/**
* Return the global image prefetcher instance.
*/
+ (SDWebImagePrefetcher *)sharedImagePrefetcher;
View
3 SDWebImage/SDWebImagePrefetcher.m
@@ -26,6 +26,7 @@ + (SDWebImagePrefetcher *)sharedImagePrefetcher
{
instance = [[SDWebImagePrefetcher alloc] init];
instance.maxConcurrentDownloads = 3;
+ instance.options = (SDWebImageLowPriority);
}
return instance;
@@ -35,7 +36,7 @@ - (void)startPrefetchingAtIndex:(NSUInteger)index withManager:(SDWebImageManager
{
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

0 comments on commit 35b6553

Please sign in to comment.