Inherits from NSObject
Declared in SDWebImageDownloader.h
SDWebImageDownloader.m

Overview

Asynchronous downloader dedicated and optimized for image loading.

Tasks

Properties

queueMode

Changes download operations unqueue mode. Default value is SDWebImageDownloaderFILOQueueMode.

@property (assign, nonatomic) SDWebImageDownloaderQueueMode queueMode

Discussion

Changes download operations unqueue mode. Default value is SDWebImageDownloaderFILOQueueMode.

Declared In

SDWebImageDownloader.h

Instance Methods

downloadImageWithURL:options:progress:completed:

Creates a SDWebImageDownloader async downloader instance with a given URL

- (id<SDWebImageOperation>)downloadImageWithURL:(NSURL *)url options:(SDWebImageDownloaderOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageDownloaderCompletedBlock)completedBlock

Parameters

url

The URL to the image to download

options

The options to be used for this download

completed

A block called once the download is completed. If the download succeeded, the image parameter is set, in case of error, error parameter is set with the error. The last parameter is always YES if SDWebImageDownloaderProgressiveDownload isn’t use. With the SDWebImageDownloaderProgressiveDownload option, this block is called repeatedly with the partial image object and the finished argument set to NO before to be called a last time with the full image and finished argument set to YES. In case of error, the finished argument is always YES.

progress

A block called repeatedly while the image is downloading

Return Value

A cancellable SDWebImageOperation

Discussion

Creates a SDWebImageDownloader async downloader instance with a given URL

The delegate will be informed when the image is finish downloaded or an error has happen.

Declared In

SDWebImageDownloader.h

setValue:forHTTPHeaderField:

Set a value for a HTTP header to be appended to each download HTTP request.

- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field

Parameters

value

The value for the header field. Use nil value to remove the header.

field

The name of the header field to set.

Discussion

Set a value for a HTTP header to be appended to each download HTTP request.

Declared In

SDWebImageDownloader.h

valueForHTTPHeaderField:

Returns the value of the specified HTTP header field.

- (NSString *)valueForHTTPHeaderField:(NSString *)field

Return Value

The value associated with the header field field, or nil if there is no corresponding header field.

Discussion

Returns the value of the specified HTTP header field.

Declared In

SDWebImageDownloader.h