SDWebImageDownloaderConfig

@interface SDWebImageDownloaderConfig : NSObject <NSCopying>

The class contains all the config for image downloader

Note

This class conform to NSCopying, make sure to add the property in copyWithZone: as well.
  • Gets the default downloader config used for shared instance or initialization when it does not provide any downloader config. Such as SDWebImageDownloader.sharedDownloader.

    Note

    You can modify the property on default downloader config, which can be used for later created downloader instance. The already created downloader instance does not get affected.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull, class) SDWebImageDownloaderConfig *defaultDownloaderConfig;

    Swift

    class var `default`: SDWebImageDownloaderConfig { get }
  • The maximum number of concurrent downloads. Defaults to 6.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger maxConcurrentDownloads;

    Swift

    var maxConcurrentDownloads: Int { get set }
  • The timeout value (in seconds) for each download operation. Defaults to 15.0.

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval downloadTimeout;

    Swift

    var downloadTimeout: TimeInterval { get set }
  • The minimum interval about progress percent during network downloading. Which means the next progress callback and current progress callback’s progress percent difference should be larger or equal to this value. However, the final finish download progress callback does not get effected. The value should be 0.0-1.0.

    Note

    If you’re using progressive decoding feature, this will also effect the image refresh rate.

    Note

    This value may enhance the performance if you don’t want progress callback too frequently. Defaults to 0, which means each time we receive the new data from URLSession, we callback the progressBlock immediately.

    Declaration

    Objective-C

    @property (nonatomic) double minimumProgressInterval;

    Swift

    var minimumProgressInterval: Double { get set }
  • The custom session configuration in use by NSURLSession. If you don’t provide one, we will use defaultSessionConfiguration instead. Defatuls to nil.

    Note

    This property does not support dynamic changes, means it’s immutable after the downloader instance initialized.

    Declaration

    Objective-C

    @property (strong, nonatomic, nullable) NSURLSessionConfiguration *sessionConfiguration;

    Swift

    var sessionConfiguration: URLSessionConfiguration? { get set }
  • Gets/Sets a subclass of SDWebImageDownloaderOperation as the default NSOperation to be used each time SDWebImage constructs a request operation to download an image. Defaults to nil.

    Note

    Passing NSOperation<SDWebImageDownloaderOperation> to set as default. Passing nil will revert to SDWebImageDownloaderOperation.

    Declaration

    Objective-C

    @property (nonatomic, nullable) Class operationClass;

    Swift

    var operationClass: AnyClass? { get set }
  • Changes download operations execution order. Defaults to SDWebImageDownloaderFIFOExecutionOrder.

    Declaration

    Objective-C

    @property (nonatomic) SDWebImageDownloaderExecutionOrder executionOrder;

    Swift

    var executionOrder: SDWebImageDownloaderExecutionOrder { get set }
  • Set the default URL credential to be set for request operations. Defaults to nil.

    Declaration

    Objective-C

    @property (copy, nonatomic, nullable) NSURLCredential *urlCredential;

    Swift

    @NSCopying var urlCredential: URLCredential? { get set }
  • Set username using for HTTP Basic authentication. Defaults to nil.

    Declaration

    Objective-C

    @property (copy, nonatomic, nullable) NSString *username;

    Swift

    var username: String? { get set }
  • Set password using for HTTP Basic authentication. Defaults to nil.

    Declaration

    Objective-C

    @property (copy, nonatomic, nullable) NSString *password;

    Swift

    var password: String? { get set }