Merge pull request #2650 from rahul-malik/fix-nsurlsessionconfig

Expose internal singleton method as a class method vs instance method in ASPINRemoteImageDownloader
This commit is contained in:
appleguy 2016-11-22 18:04:58 -08:00 committed by GitHub
commit b0644dba3b

View File

@ -103,15 +103,10 @@ static ASPINRemoteImageDownloader *sharedDownloader = nil;
+ (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration
{ {
NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured.");
__unused PINRemoteImageManager *sharedManager = [[self class] sharedPINRemoteImageManagerWithConfiguration:configuration]; __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration];
} }
- (PINRemoteImageManager *)sharedPINRemoteImageManager + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration
{
return [self sharedPINRemoteImageManagerWithConfiguration:nil];
}
- (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration
{ {
static ASPINRemoteImageManager *sharedPINRemoteImageManager; static ASPINRemoteImageManager *sharedPINRemoteImageManager;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
@ -141,6 +136,11 @@ static ASPINRemoteImageDownloader *sharedDownloader = nil;
return sharedPINRemoteImageManager; return sharedPINRemoteImageManager;
} }
- (PINRemoteImageManager *)sharedPINRemoteImageManager
{
return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil];
}
- (BOOL)sharedImageManagerSupportsMemoryRemoval - (BOOL)sharedImageManagerSupportsMemoryRemoval
{ {
static BOOL sharedImageManagerSupportsMemoryRemoval = NO; static BOOL sharedImageManagerSupportsMemoryRemoval = NO;