Merge branch 'refactor_downloader_config' into 5.x
This commit is contained in:
commit
00a0e01a32
|
@ -25,6 +25,7 @@ typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
|
|||
|
||||
/**
|
||||
Gets/Sets 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.
|
||||
@note You should not pass nil to this value.
|
||||
*/
|
||||
@property (nonatomic, class, nonnull) SDWebImageDownloaderConfig *defaultDownloaderConfig;
|
||||
|
|
|
@ -13,9 +13,10 @@ static SDWebImageDownloaderConfig * _defaultDownloaderConfig;
|
|||
@implementation SDWebImageDownloaderConfig
|
||||
|
||||
+ (SDWebImageDownloaderConfig *)defaultDownloaderConfig {
|
||||
if (!_defaultDownloaderConfig) {
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_defaultDownloaderConfig = [SDWebImageDownloaderConfig new];
|
||||
}
|
||||
});
|
||||
return _defaultDownloaderConfig;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue