From e3ca0dcad423909a1b7d11b3a32b50b7d0674181 Mon Sep 17 00:00:00 2001 From: ErnestMa Date: Mon, 17 Sep 2018 11:27:33 -0700 Subject: [PATCH 1/9] add a method for setting preconfigured PINRemoteImageManager instead of using the self-created ASPINRemoteImageManager --- Source/Details/ASPINRemoteImageDownloader.h | 9 +++++++++ Source/Details/ASPINRemoteImageDownloader.m | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Source/Details/ASPINRemoteImageDownloader.h b/Source/Details/ASPINRemoteImageDownloader.h index 26567027e..e313ed0ce 100644 --- a/Source/Details/ASPINRemoteImageDownloader.h +++ b/Source/Details/ASPINRemoteImageDownloader.h @@ -40,6 +40,15 @@ NS_ASSUME_NONNULL_BEGIN */ + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration; +/** + * Sets a custom perconconfigured PINRemoteImageManager that will be used by @c ASNetworkImageNodes and @c ASMultiplexImageNodes + * while loading images off the network. This can be called at anytime. Once this is set, it will always be used with priority. + * If this is not set, it will call setSharedImageManagerWithConfiguration with nil. + * + * @param PINRemoteImageManager the preconfigured remote image manager that will be used by `sharedDownloader` + */ +- (void)setPreconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager; + /** * The shared instance of a @c PINRemoteImageManager used by all @c ASPINRemoteImageDownloaders * diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index 571c5de57..5f9e8da69 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -75,6 +75,10 @@ @interface ASPINRemoteImageManager : PINRemoteImageManager @end @implementation ASPINRemoteImageManager +{ +@private + PINRemoteImageManager *_preconfiguredPINRemoteImageManager; +} //Share image cache with sharedImageManager image cache. - (id )defaultImageCache @@ -155,9 +159,18 @@ + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSe - (PINRemoteImageManager *)sharedPINRemoteImageManager { + if (_preconfiguredPINRemoteImageManager) { + return _preconfiguredPINRemoteImageManager; + } return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil]; } +- (PINRemoteImageManager *)setPreconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager +{ + _preconfiguredPINRemoteImageManager = preconfiguredPINRemoteImageManager; + return _preconfiguredPINRemoteImageManager; +} + - (BOOL)sharedImageManagerSupportsMemoryRemoval { static BOOL sharedImageManagerSupportsMemoryRemoval = NO; From f189a83f2e91d24be4ecd730855dcc14774009c4 Mon Sep 17 00:00:00 2001 From: ErnestMa Date: Mon, 17 Sep 2018 14:07:08 -0700 Subject: [PATCH 2/9] update preconfigured image manager where it can only be set once --- Source/Details/ASPINRemoteImageDownloader.h | 7 ++- Source/Details/ASPINRemoteImageDownloader.m | 69 ++++++++++----------- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.h b/Source/Details/ASPINRemoteImageDownloader.h index e313ed0ce..cd798d68a 100644 --- a/Source/Details/ASPINRemoteImageDownloader.h +++ b/Source/Details/ASPINRemoteImageDownloader.h @@ -42,12 +42,13 @@ NS_ASSUME_NONNULL_BEGIN /** * Sets a custom perconconfigured PINRemoteImageManager that will be used by @c ASNetworkImageNodes and @c ASMultiplexImageNodes - * while loading images off the network. This can be called at anytime. Once this is set, it will always be used with priority. - * If this is not set, it will call setSharedImageManagerWithConfiguration with nil. + * while loading images off the network. This must be specified early in the application lifecycle before + * `sharedDownloader` is accessed. If nil is passed in as the PINRemoteImageManager, it will call + * setSharedImageManagerWithConfiguration with nil configuration. * * @param PINRemoteImageManager the preconfigured remote image manager that will be used by `sharedDownloader` */ -- (void)setPreconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager; ++ (void)setSharedPreconfiguredRemoteImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager; /** * The shared instance of a @c PINRemoteImageManager used by all @c ASPINRemoteImageDownloaders diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index 5f9e8da69..fa1fd28ec 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -75,10 +75,6 @@ @interface ASPINRemoteImageManager : PINRemoteImageManager @end @implementation ASPINRemoteImageManager -{ -@private - PINRemoteImageManager *_preconfiguredPINRemoteImageManager; -} //Share image cache with sharedImageManager image cache. - (id )defaultImageCache @@ -123,52 +119,53 @@ + (ASPINRemoteImageDownloader *)sharedDownloader NS_RETURNS_RETAINED + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration { NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); - __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration]; + __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration preconfiguredPINRemoteImageManager:nil]; } -+ (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration ++ (void)setSharedPreconfiguredImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager { - static ASPINRemoteImageManager *sharedPINRemoteImageManager; + NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); + __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:nil preconfiguredPINRemoteImageManager:preconfiguredPINRemoteImageManager]; +} + ++ (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration preconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager +{ + static PINRemoteImageManager *sharedPINRemoteImageManager; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - + + if (preconfiguredPINRemoteImageManager) { + sharedPINRemoteImageManager = preconfiguredPINRemoteImageManager; + } else { #if PIN_ANIMATED_AVAILABLE - // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each - if (!(NSClassFromString(@"PINRemoteImageManager"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINRemoteImage framework." - userInfo:nil]; - @throw e; - } - if (!(NSClassFromString(@"PINCache"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINCache framework." - userInfo:nil]; - @throw e; - } - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration - alternativeRepresentationProvider:[self sharedDownloader]]; + // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each + if (!(NSClassFromString(@"PINRemoteImageManager"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINRemoteImage framework." + userInfo:nil]; + @throw e; + } + if (!(NSClassFromString(@"PINCache"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINCache framework." + userInfo:nil]; + @throw e; + } + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration + alternativeRepresentationProvider:[self sharedDownloader]]; #else - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; #endif + } }); return sharedPINRemoteImageManager; } - (PINRemoteImageManager *)sharedPINRemoteImageManager { - if (_preconfiguredPINRemoteImageManager) { - return _preconfiguredPINRemoteImageManager; - } - return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil]; -} - -- (PINRemoteImageManager *)setPreconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager -{ - _preconfiguredPINRemoteImageManager = preconfiguredPINRemoteImageManager; - return _preconfiguredPINRemoteImageManager; + return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil preconfiguredPINRemoteImageManager:nil]; } - (BOOL)sharedImageManagerSupportsMemoryRemoval From 9919bdbb20014c9373502af907b2c52174bbbe9f Mon Sep 17 00:00:00 2001 From: ErnestMa Date: Mon, 17 Sep 2018 14:09:09 -0700 Subject: [PATCH 3/9] fix spacing in downloader --- Source/Details/ASPINRemoteImageDownloader.m | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index fa1fd28ec..f13dfe6ec 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -138,25 +138,25 @@ + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSe sharedPINRemoteImageManager = preconfiguredPINRemoteImageManager; } else { #if PIN_ANIMATED_AVAILABLE - // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each - if (!(NSClassFromString(@"PINRemoteImageManager"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINRemoteImage framework." - userInfo:nil]; - @throw e; - } - if (!(NSClassFromString(@"PINCache"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINCache framework." - userInfo:nil]; - @throw e; - } - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration - alternativeRepresentationProvider:[self sharedDownloader]]; + // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each + if (!(NSClassFromString(@"PINRemoteImageManager"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINRemoteImage framework." + userInfo:nil]; + @throw e; + } + if (!(NSClassFromString(@"PINCache"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINCache framework." + userInfo:nil]; + @throw e; + } + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration + alternativeRepresentationProvider:[self sharedDownloader]]; #else - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; #endif } }); From 843006055c487cf2aa18e59603d665f164c0102f Mon Sep 17 00:00:00 2001 From: ErnestMa Date: Mon, 17 Sep 2018 14:19:37 -0700 Subject: [PATCH 4/9] Fix doc/comments on new api --- Source/Details/ASPINRemoteImageDownloader.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.h b/Source/Details/ASPINRemoteImageDownloader.h index cd798d68a..c262c5d7e 100644 --- a/Source/Details/ASPINRemoteImageDownloader.h +++ b/Source/Details/ASPINRemoteImageDownloader.h @@ -41,12 +41,12 @@ NS_ASSUME_NONNULL_BEGIN + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration; /** - * Sets a custom perconconfigured PINRemoteImageManager that will be used by @c ASNetworkImageNodes and @c ASMultiplexImageNodes + * Sets a custom preconfigured PINRemoteImageManager that will be used by @c ASNetworkImageNodes and @c ASMultiplexImageNodes * while loading images off the network. This must be specified early in the application lifecycle before - * `sharedDownloader` is accessed. If nil is passed in as the PINRemoteImageManager, it will call - * setSharedImageManagerWithConfiguration with nil configuration. + * `sharedDownloader` is accessed. If nil is passed in as the PINRemoteImageManager, it will create + * a default image manager with a nil session configuration. * - * @param PINRemoteImageManager the preconfigured remote image manager that will be used by `sharedDownloader` + * @param PINRemoteImageManager The preconfigured remote image manager that will be used by `sharedDownloader` */ + (void)setSharedPreconfiguredRemoteImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager; From b23daf66c6c0a68aaa400b59d92091491a43026f Mon Sep 17 00:00:00 2001 From: ErnestMa Date: Mon, 17 Sep 2018 15:27:44 -0700 Subject: [PATCH 5/9] adding assertion to ensure either only configuration or preconfigure image manager can be set at a time --- Source/Details/ASPINRemoteImageDownloader.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index f13dfe6ec..38dede86f 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -100,6 +100,8 @@ @implementation ASPINRemoteImageManager static ASPINRemoteImageDownloader *sharedDownloader = nil; +static PINRemoteImageManager *sharedPINRemoteImageManager = nil; +static dispatch_once_t onceToken; @interface ASPINRemoteImageDownloader () @end @@ -119,21 +121,22 @@ + (ASPINRemoteImageDownloader *)sharedDownloader NS_RETURNS_RETAINED + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration { NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); + NSAssert(sharedPINRemoteImageManager == nil, [NSString stringWithFormat:@"An instance of %@ has been set. Either configuration or preconfigured image manager can be set at a time and only once.", NSStringFromClass([sharedPINRemoteImageManager class])]); __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration preconfiguredPINRemoteImageManager:nil]; } + (void)setSharedPreconfiguredImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager { NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); + NSAssert(sharedPINRemoteImageManager == nil, [NSString stringWithFormat:@"An instance of %@ has been set. Either configuration or preconfigured image manager can be set at a time and only once.", NSStringFromClass([sharedPINRemoteImageManager class])]); __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:nil preconfiguredPINRemoteImageManager:preconfiguredPINRemoteImageManager]; } + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration preconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager { - static PINRemoteImageManager *sharedPINRemoteImageManager; - static dispatch_once_t onceToken; + NSAssert(configuration != nil && preconfiguredPINRemoteImageManager != nil, @"Either configuration or preconfigured image manager can be set at a time."); dispatch_once(&onceToken, ^{ - + if (preconfiguredPINRemoteImageManager) { sharedPINRemoteImageManager = preconfiguredPINRemoteImageManager; } else { From 683ca29ed4cbac5769e28980ce6faad20142ec96 Mon Sep 17 00:00:00 2001 From: ErnestMa Date: Mon, 17 Sep 2018 15:27:44 -0700 Subject: [PATCH 6/9] adding assertion to ensure either only configuration or preconfigure image manager can be set at a time --- Source/Details/ASPINRemoteImageDownloader.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index f13dfe6ec..58ee4c384 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -100,6 +100,8 @@ @implementation ASPINRemoteImageManager static ASPINRemoteImageDownloader *sharedDownloader = nil; +static PINRemoteImageManager *sharedPINRemoteImageManager = nil; +static dispatch_once_t onceToken; @interface ASPINRemoteImageDownloader () @end @@ -119,21 +121,22 @@ + (ASPINRemoteImageDownloader *)sharedDownloader NS_RETURNS_RETAINED + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration { 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]); __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration preconfiguredPINRemoteImageManager:nil]; } + (void)setSharedPreconfiguredImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager { 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]); __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:nil preconfiguredPINRemoteImageManager:preconfiguredPINRemoteImageManager]; } + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration preconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager { - static PINRemoteImageManager *sharedPINRemoteImageManager; - static dispatch_once_t onceToken; + NSAssert(configuration != nil && preconfiguredPINRemoteImageManager != nil, @"Either configuration or preconfigured image manager can be set at a time."); dispatch_once(&onceToken, ^{ - + if (preconfiguredPINRemoteImageManager) { sharedPINRemoteImageManager = preconfiguredPINRemoteImageManager; } else { From a2bdf7b8a464a7d21558f2a6836c616e0327c276 Mon Sep 17 00:00:00 2001 From: ErnestMa Date: Mon, 17 Sep 2018 15:49:55 -0700 Subject: [PATCH 7/9] fix assertion condition --- Source/Details/ASPINRemoteImageDownloader.m | 38 ++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index 58ee4c384..47de18bac 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -134,32 +134,32 @@ + (void)setSharedPreconfiguredImageManager:(nullable PINRemoteImageManager *)pre + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration preconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager { - NSAssert(configuration != nil && preconfiguredPINRemoteImageManager != nil, @"Either configuration or preconfigured image manager can be set at a time."); + NSAssert(!(configuration != nil && preconfiguredPINRemoteImageManager != nil), @"Either configuration or preconfigured image manager can be set at a time."); dispatch_once(&onceToken, ^{ if (preconfiguredPINRemoteImageManager) { sharedPINRemoteImageManager = preconfiguredPINRemoteImageManager; } else { #if PIN_ANIMATED_AVAILABLE - // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each - if (!(NSClassFromString(@"PINRemoteImageManager"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINRemoteImage framework." - userInfo:nil]; - @throw e; - } - if (!(NSClassFromString(@"PINCache"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINCache framework." - userInfo:nil]; - @throw e; - } - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration - alternativeRepresentationProvider:[self sharedDownloader]]; + // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each + if (!(NSClassFromString(@"PINRemoteImageManager"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINRemoteImage framework." + userInfo:nil]; + @throw e; + } + if (!(NSClassFromString(@"PINCache"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINCache framework." + userInfo:nil]; + @throw e; + } + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration + alternativeRepresentationProvider:[self sharedDownloader]]; #else - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; #endif } }); From 2dbef333757fcdd4951f6e92dfe0ac533b729058 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Mon, 17 Sep 2018 16:09:37 -0700 Subject: [PATCH 8/9] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b63ac997c..fe8b26cb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ - Improve locking around clearContents [Michael Schneider](https://github.com/maicki) - Unlock before cleanup and calling out to subclass hooks for animated images. [Michael Schneider](https://github.com/maicki) [#1087](https://github.com/TextureGroup/Texture/pull/1087) - [ASDisplayNode] Fix interface state update for layer backed nodes when layer thrashes (interface coaleascing case).[Max Wang](https://github.com/wsdwsd0829). [#1111](https://github.com/TextureGroup/Texture/pull/1111) +- [ASPINRemoteImageManager] Add a new API for setting a preconfigured PINRemoteImageManager. [Ernest Ma](https://github.com/ernestmama) [#1124](https://github.com/TextureGroup/Texture/pull/1124) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) From e19bb45468f334030e787a7539ee6dfefd4b2c3d Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Mon, 17 Sep 2018 16:22:45 -0700 Subject: [PATCH 9/9] Remove unnecessary change --- Source/Details/ASPINRemoteImageDownloader.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index 47de18bac..ad541fc3b 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -101,7 +101,6 @@ @implementation ASPINRemoteImageManager static ASPINRemoteImageDownloader *sharedDownloader = nil; static PINRemoteImageManager *sharedPINRemoteImageManager = nil; -static dispatch_once_t onceToken; @interface ASPINRemoteImageDownloader () @end @@ -135,6 +134,7 @@ + (void)setSharedPreconfiguredImageManager:(nullable PINRemoteImageManager *)pre + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration preconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager { NSAssert(!(configuration != nil && preconfiguredPINRemoteImageManager != nil), @"Either configuration or preconfigured image manager can be set at a time."); + static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ if (preconfiguredPINRemoteImageManager) {