LuxChat  2.0
Instant messenger for iOS
Instance Methods | Class Methods | Properties | List of all members
SDWebImageDownloader Class Reference

#import <SDWebImageDownloader.h>

Inheritance diagram for SDWebImageDownloader:

Instance Methods

(void) - setValue:forHTTPHeaderField:
 
(NSString *) - valueForHTTPHeaderField:
 
(void) - setOperationClass:
 
(id< SDWebImageOperation >) - downloadImageWithURL:options:progress:completed:
 
(void) - setSuspended:
 

Class Methods

(SDWebImageDownloader *) + sharedDownloader
 

Properties

BOOL shouldDecompressImages
 
NSInteger maxConcurrentDownloads
 
NSUInteger currentDownloadCount
 
NSTimeInterval downloadTimeout
 
SDWebImageDownloaderExecutionOrder executionOrder
 
NSString * username
 
NSString * password
 
SDWebImageDownloaderHeadersFilterBlock headersFilter
 

Detailed Description

Asynchronous downloader dedicated and optimized for image loading.

Method Documentation

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

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.

See also
SDWebImageDownloaderDelegate
Parameters
urlThe URL to the image to download
optionsThe options to be used for this download
progressBlockA block called repeatedly while the image is downloading
completedBlockA 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.
Returns
A cancellable SDWebImageOperation
- (void) setOperationClass: (Class)  operationClass

Sets a subclass of SDWebImageDownloaderOperation as the default NSOperation to be used each time SDWebImage constructs a request operation to download an image.

Parameters
operationClassThe subclass of SDWebImageDownloaderOperation to set as default. Passing nil will revert to SDWebImageDownloaderOperation.
- (void) setSuspended: (BOOL)  suspended

Sets the download queue suspension state

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

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

Parameters
valueThe value for the header field. Use nil value to remove the header.
fieldThe name of the header field to set.
+ (SDWebImageDownloader *) sharedDownloader

Singleton method, returns the shared instance

Returns
global shared instance of downloader class
- (NSString *) valueForHTTPHeaderField: (NSString *)  field

Returns the value of the specified HTTP header field.

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

Property Documentation

- (NSUInteger) currentDownloadCount
readnonatomicassign

Shows the current amount of downloads that still need to be downloaded

- (NSTimeInterval) downloadTimeout
readwritenonatomicassign

The timeout value (in seconds) for the download operation. Default: 15.0.

- (SDWebImageDownloaderExecutionOrder) executionOrder
readwritenonatomicassign

Changes download operations execution order. Default value is SDWebImageDownloaderFIFOExecutionOrder.

- (SDWebImageDownloaderHeadersFilterBlock) headersFilter
readwritenonatomiccopy

Set filter to pick headers for downloading image HTTP request.

This block will be invoked for each downloading image request, returned NSDictionary will be used as headers in corresponding HTTP request.

- (NSString*) password
readwritenonatomicstrong

Set password

- (BOOL) shouldDecompressImages
readwritenonatomicassign

Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory. Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption.

- (NSString*) username
readwritenonatomicstrong

Set username


The documentation for this class was generated from the following files: