Inherits from NSObject
Declared in SDWebImagePrefetcher.h
SDWebImagePrefetcher.m

Overview

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

Tasks

Properties

maxConcurrentDownloads

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

@property (nonatomic, assign) NSUInteger maxConcurrentDownloads

Discussion

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

Declared In

SDWebImagePrefetcher.h

options

SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.

@property (nonatomic, assign) SDWebImageOptions options

Discussion

SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.

Declared In

SDWebImagePrefetcher.h

Class Methods

sharedImagePrefetcher

Return the global image prefetcher instance.

+ (SDWebImagePrefetcher *)sharedImagePrefetcher

Discussion

Return the global image prefetcher instance.

Declared In

SDWebImagePrefetcher.h

Instance Methods

cancelPrefetching

Remove and cancel queued list

- (void)cancelPrefetching

Discussion

Remove and cancel queued list

Declared In

SDWebImagePrefetcher.h

prefetchURLs:

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

- (void)prefetchURLs:(NSArray *)urls

Parameters

urls

list of URLs to prefetch

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

Declared In

SDWebImagePrefetcher.h

prefetchURLs:completed:

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

- (void)prefetchURLs:(NSArray *)urls completed:(void ( ^ ) ( NSUInteger finishedCount , NSUInteger skippedCount ))completionBlock

Parameters

urls

list of URLs to prefetch

completionBlock

block to be called when prefetching is completed

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

Declared In

SDWebImagePrefetcher.h