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
{
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
{
return [self sharedPINRemoteImageManagerWithConfiguration:nil];
}
- (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration
+ (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration
{
static ASPINRemoteImageManager *sharedPINRemoteImageManager;
static dispatch_once_t onceToken;
@ -141,6 +136,11 @@ static ASPINRemoteImageDownloader *sharedDownloader = nil;
return sharedPINRemoteImageManager;
}
- (PINRemoteImageManager *)sharedPINRemoteImageManager
{
return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil];
}
- (BOOL)sharedImageManagerSupportsMemoryRemoval
{
static BOOL sharedImageManagerSupportsMemoryRemoval = NO;