Inherits from NSObject
Declared in SDWebImagePrefetcher.h

Overview

Prefetch some URLs in the cache for future use. Images are downloaded in low priority.

Tasks

Properties

delegate

@property (weak, nonatomic) id<SDWebImagePrefetcherDelegate> delegate

manager

@property (strong, nonatomic, readonly) SDWebImageManager *manager
Discussion

The web image manager

Declared In

SDWebImagePrefetcher.h

maxConcurrentDownloads

@property (nonatomic, assign) NSUInteger maxConcurrentDownloads
Discussion

Maximum number of URLs to prefetch at the same time. Defaults to 3.

Declared In

SDWebImagePrefetcher.h

options

@property (nonatomic, assign) SDWebImageOptions options
Discussion

SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.

Declared In

SDWebImagePrefetcher.h

prefetcherQueue

@property (nonatomic, assign) dispatch_queue_t prefetcherQueue
Discussion

Queue options for Prefetcher. Defaults to Main Queue.

Declared In

SDWebImagePrefetcher.h

Class Methods

sharedImagePrefetcher

+ (SDWebImagePrefetcher *)sharedImagePrefetcher
Discussion

Return the global image prefetcher instance.

Declared In

SDWebImagePrefetcher.h

Instance Methods

cancelPrefetching

- (void)cancelPrefetching
Discussion

Remove and cancel queued list

Declared In

SDWebImagePrefetcher.h

prefetchURLs:

- (void)prefetchURLs:(NSArray *)urls
Discussion

Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, currently one image is downloaded at a time, and skips images for failed downloads and proceed to the next image in the list

Parameters

urls

list of URLs to prefetch

Declared In

SDWebImagePrefetcher.h

prefetchURLs:progress:completed:

- (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock
Discussion

Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, currently one image is downloaded at a time, and skips images for failed downloads and proceed to the next image in the list

Parameters

urls

list of URLs to prefetch

progressBlock

block to be called when progress updates; first parameter is the number of completed (successful or not) requests, second parameter is the total number of images originally requested to be prefetched

completionBlock

block to be called when prefetching is completed first param is the number of completed (successful or not) requests, second parameter is the number of skipped requests

Declared In

SDWebImagePrefetcher.h