diff --git a/Source/Details/ASPINRemoteImageDownloader.mm b/Source/Details/ASPINRemoteImageDownloader.mm index 16a7795ba..35b1c919b 100644 --- a/Source/Details/ASPINRemoteImageDownloader.mm +++ b/Source/Details/ASPINRemoteImageDownloader.mm @@ -115,6 +115,7 @@ + (ASPINRemoteImageDownloader *)sharedDownloader NS_RETURNS_RETAINED + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration { + NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); PINRemoteImageManager *sharedManager = [self PINRemoteImageManagerWithConfiguration:configuration imageCache:nil]; [self setSharedPreconfiguredRemoteImageManager:sharedManager]; } @@ -122,6 +123,7 @@ + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfigurati + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration imageCache:(nullable id)imageCache { + NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); PINRemoteImageManager *sharedManager = [self PINRemoteImageManagerWithConfiguration:configuration imageCache:imageCache]; [self setSharedPreconfiguredRemoteImageManager:sharedManager]; } @@ -131,7 +133,6 @@ + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfigurati + (void)setSharedPreconfiguredRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager { NSAssert(preconfiguredPINRemoteImageManager != nil, @"setSharedPreconfiguredRemoteImageManager requires a non-nil parameter"); - NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); NSAssert1(sharedPINRemoteImageManager == nil, @"An instance of %@ has been set. Either configuration or preconfigured image manager can be set at a time and only once.", [[sharedPINRemoteImageManager class] description]); dispatch_once(&shared_init_predicate, ^{