SDWebImageDownloader Class Reference
| Inherits from | NSObject |
| Declared in | SDWebImageDownloader.h SDWebImageDownloader.m |
Tasks
-
currentDownloadCountproperty -
downloadTimeoutproperty -
executionOrderproperty -
headersFilterproperty -
– setValue:forHTTPHeaderField: -
– valueForHTTPHeaderField: -
– downloadImageWithURL:options:progress:completed:
Properties
currentDownloadCount
Shows the current amount of downloads that still need to be downloaded
@property (readonly, nonatomic) NSUInteger currentDownloadCountDeclared In
SDWebImageDownloader.hdownloadTimeout
The timeout value (in seconds) for the download operation. Default: 15.0.
@property (assign, nonatomic) NSTimeInterval downloadTimeoutDeclared In
SDWebImageDownloader.hexecutionOrder
Changes download operations execution order. Default value is SDWebImageDownloaderFIFOExecutionOrder.
@property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrderDeclared In
SDWebImageDownloader.hheadersFilter
Set filter to pick headers for downloading image HTTP request.
@property (nonatomic, strong) NSDictionary *^ ) ( NSURL *url , NSDictionary *headers ) headersFilterDiscussion
This block will be invoked for each downloading image request, returned NSDictionary will be used as headers in corresponding HTTP request.
Declared In
SDWebImageDownloader.hInstance 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)completedBlockParameters
- url
The URL to the image to download
- options
The options to be used for this download
- progressBlock
A block called repeatedly while the image is downloading
- completedBlock
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.
Return Value
A cancellable SDWebImageOperation
Discussion
The delegate will be informed when the image is finish downloaded or an error has happen.
Declared In
SDWebImageDownloader.hsetValue:forHTTPHeaderField:
Set a value for a HTTP header to be appended to each download HTTP request.
- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)fieldParameters
- value
The value for the header field. Use
nilvalue to remove the header.
- field
The name of the header field to set.
Declared In
SDWebImageDownloader.h