From 26723a12ef353fcdf314b5953be452c2b04150cb Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 18 Aug 2017 15:40:28 +0100 Subject: [PATCH 01/10] Improve poster image fetch performance. --- Pod/Classes/WPPHAssetDataSource.m | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index 050a97b4..6a1e822d 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -558,6 +558,7 @@ @interface PHAssetCollectionForWPMediaGroup() @property(nonatomic, strong) PHAsset *posterAsset; @property(nonatomic, assign) WPMediaType mediaType; @property(nonatomic, strong) PHFetchResult *fetchResult; +@property(nonatomic, strong) PHFetchResult *posterAssetFetchResult; @end @@ -626,9 +627,20 @@ - (PHFetchResult *)fetchResult { return _fetchResult; } +- (PHFetchResult *)posterAssetFetchResult { + if (!_posterAssetFetchResult) { + PHFetchOptions *fetchOptions = [PHFetchOptions new]; + fetchOptions.fetchLimit = 1; + fetchOptions.predicate = [WPPHAssetDataSource predicateForFilterMediaType:_mediaType]; + _posterAssetFetchResult = [PHAsset fetchKeyAssetsInAssetCollection:self.collection options:fetchOptions]; + } + + return _posterAssetFetchResult; +} + - (PHAsset *)posterAsset { if (!_posterAsset) { - _posterAsset = [[self fetchResult] lastObject]; + _posterAsset = [[self posterAssetFetchResult] lastObject]; } return _posterAsset; From 5c26838bef74a8216ca2f6487a7a619339ebcd48 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 18 Aug 2017 15:59:52 +0100 Subject: [PATCH 02/10] Limit the number of search on start. --- Pod/Classes/WPPHAssetDataSource.m | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index 6a1e822d..77eb3fb8 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -192,14 +192,15 @@ - (void)loadGroupsWithSuccess:(WPMediaSuccessBlock)successBlock { PHFetchOptions *fetchOptions = [PHFetchOptions new]; fetchOptions.predicate = [[self class] predicateForFilterMediaType:self.mediaTypeFilter]; + fetchOptions.fetchLimit = 1; NSMutableArray *collectionsArray=[NSMutableArray array]; for (NSNumber *subType in [self smartAlbumsToShow]) { PHFetchResult * smartAlbum = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:[subType intValue] options:nil]; PHAssetCollection *collection = (PHAssetCollection *)smartAlbum.firstObject; - if ([PHAsset fetchAssetsInAssetCollection:collection options:fetchOptions].count > 0 || [subType intValue] == PHAssetCollectionSubtypeSmartAlbumUserLibrary){ - [collectionsArray addObjectsFromArray:[smartAlbum objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, smartAlbum.count)]]]; + if ([subType intValue] == PHAssetCollectionSubtypeSmartAlbumUserLibrary || [PHAsset fetchAssetsInAssetCollection:collection options:fetchOptions].count > 0){ + [collectionsArray addObject:collection]; } } @@ -605,11 +606,6 @@ - (NSString *)identifier - (NSInteger)numberOfAssetsOfType:(WPMediaType)mediaType { - NSInteger count = self.collection.estimatedAssetCount; - if (count != NSNotFound) { - return count; - } - if (self.assetCount == NSNotFound) { self.assetCount = [self.fetchResult count]; } From 6e7ca023243e8d3b758c934cc35a01f8cc98d463 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Mon, 21 Aug 2017 17:59:00 +0100 Subject: [PATCH 03/10] Fetch albums without limiting by media type. --- Pod/Classes/WPPHAssetDataSource.m | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index 77eb3fb8..36a89b5c 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -190,18 +190,13 @@ - (NSArray *)smartAlbumsToShow { - (void)loadGroupsWithSuccess:(WPMediaSuccessBlock)successBlock failure:(WPMediaFailureBlock)failureBlock { - PHFetchOptions *fetchOptions = [PHFetchOptions new]; - fetchOptions.predicate = [[self class] predicateForFilterMediaType:self.mediaTypeFilter]; - fetchOptions.fetchLimit = 1; NSMutableArray *collectionsArray=[NSMutableArray array]; for (NSNumber *subType in [self smartAlbumsToShow]) { PHFetchResult * smartAlbum = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:[subType intValue] options:nil]; PHAssetCollection *collection = (PHAssetCollection *)smartAlbum.firstObject; - if ([subType intValue] == PHAssetCollectionSubtypeSmartAlbumUserLibrary || [PHAsset fetchAssetsInAssetCollection:collection options:fetchOptions].count > 0){ - [collectionsArray addObject:collection]; - } + [collectionsArray addObject:collection]; } self.albums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum @@ -209,9 +204,7 @@ - (void)loadGroupsWithSuccess:(WPMediaSuccessBlock)successBlock options:nil]; [self.albums enumerateObjectsUsingBlock:^(PHAssetCollection *collection, NSUInteger index, BOOL *stop){ - if ([PHAsset fetchAssetsInAssetCollection:collection options:fetchOptions].count > 0) { - [collectionsArray addObject:collection]; - } + [collectionsArray addObject:collection]; }]; PHCollectionList *allAlbums = [PHCollectionList transientCollectionListWithCollections:collectionsArray title:@"Root"]; From 96f5fd70578d4362e71ebb22c001983684632cf7 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 22 Aug 2017 14:37:43 +0100 Subject: [PATCH 04/10] Make the fetch of the real count of group assets async. --- Pod/Classes/WPMediaCollectionDataSource.h | 11 +++++++---- Pod/Classes/WPMediaGroupPickerViewController.m | 6 +++++- Pod/Classes/WPPHAssetDataSource.m | 10 +++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Pod/Classes/WPMediaCollectionDataSource.h b/Pod/Classes/WPMediaCollectionDataSource.h index 71814a9e..584b469e 100644 --- a/Pod/Classes/WPMediaCollectionDataSource.h +++ b/Pod/Classes/WPMediaCollectionDataSource.h @@ -28,6 +28,7 @@ typedef void (^WPMediaSuccessBlock)(); typedef void (^WPMediaFailureBlock)(NSError *error); typedef void (^WPMediaAddedBlock)(id media, NSError *error); typedef void (^WPMediaImageBlock)(UIImage *result, NSError *error); +typedef void (^WPMediaCountBlock)(NSInteger result, NSError *error); typedef void (^WPMediaAssetBlock)(AVAsset *asset, NSError *error); typedef int32_t WPMediaRequestID; @@ -68,11 +69,13 @@ typedef int32_t WPMediaRequestID; - (NSString *)identifier; /** - * The numbers of assets that exist in the group - * - * @return The numbers of assets that exist in the group + The numbers of assets that exist in the group of a certain mediaType + + @param mediaType the asset type to count + @param completionHandler a block that is executed when the real number of assets is know. + @return return an estimation of the current number of assets, if no estimate is known return NSNotFound */ -- (NSInteger)numberOfAssetsOfType:(WPMediaType)mediaType; +- (NSInteger)numberOfAssetsOfType:(WPMediaType)mediaType completionHandler:(WPMediaCountBlock)completionHandler; @end diff --git a/Pod/Classes/WPMediaGroupPickerViewController.m b/Pod/Classes/WPMediaGroupPickerViewController.m index df6b8a02..6946103c 100644 --- a/Pod/Classes/WPMediaGroupPickerViewController.m +++ b/Pod/Classes/WPMediaGroupPickerViewController.m @@ -135,7 +135,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N }]; cell.tag = requestKey; cell.titleLabel.text = [group name]; - NSInteger numberOfAssets = [group numberOfAssetsOfType:[self.dataSource mediaTypeFilter]]; + NSInteger numberOfAssets = [group numberOfAssetsOfType:[self.dataSource mediaTypeFilter] completionHandler:^(NSInteger result, NSError *error) { + dispatch_async(dispatch_get_main_queue(), ^{ + cell.countLabel.text = [NSString stringWithFormat:@"%ld", (long)result]; + }); + }]; if (numberOfAssets != NSNotFound) { cell.countLabel.text = [NSString stringWithFormat:@"%ld", (long)numberOfAssets]; } else { diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index 36a89b5c..12b66f0e 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -597,13 +597,13 @@ - (NSString *)identifier return [self.collection localIdentifier]; } -- (NSInteger)numberOfAssetsOfType:(WPMediaType)mediaType +- (NSInteger)numberOfAssetsOfType:(WPMediaType)mediaType completionHandler:(WPMediaCountBlock)completionHandler { - if (self.assetCount == NSNotFound) { + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ self.assetCount = [self.fetchResult count]; - } - - return self.assetCount; + completionHandler(self.assetCount, nil); + }); + return self.collection.estimatedAssetCount; } - (PHFetchResult *)fetchResult { From 0192fe1a0a562152df5a9f92e5edc1f51cee0819 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 22 Aug 2017 15:04:18 +0100 Subject: [PATCH 05/10] Improve loading of data methods to avoid redundant code. --- Pod/Classes/WPMediaCollectionDataSource.h | 15 +++++++---- .../WPMediaGroupPickerViewController.m | 2 +- Pod/Classes/WPMediaPickerViewController.m | 2 +- Pod/Classes/WPPHAssetDataSource.m | 26 +++++++++++++------ 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Pod/Classes/WPMediaCollectionDataSource.h b/Pod/Classes/WPMediaCollectionDataSource.h index 584b469e..fb947654 100644 --- a/Pod/Classes/WPMediaCollectionDataSource.h +++ b/Pod/Classes/WPMediaCollectionDataSource.h @@ -21,6 +21,13 @@ typedef NS_ENUM(NSInteger, WPMediaPickerErrorCode){ - (NSUInteger)to; @end +typedef NS_ENUM(NSInteger, WPMediaLoadOptions){ + WPMediaLoadOptionsGroups, + WPMediaLoadOptionsAssets, + WPMediaLoadOptionsGroupsAndAssets +}; + + @protocol WPMediaAsset; typedef void (^WPMediaChangesBlock)(BOOL incrementalChanges, NSIndexSet *removed, NSIndexSet *inserted, NSIndexSet *changed, NSArray> *moves); @@ -253,16 +260,14 @@ typedef int32_t WPMediaRequestID; * Asks the data source to reload the data available of the media library. This should be invoked after changing the * current active group or if a change is detected. * + * @param options specifiy what type of data to load * @param successBlock a block that is invoked when the data is loaded with success. * @param failureBlock a block that is invoked when the are is any kind of error when loading the data. */ -- (void)loadDataWithSuccess:(WPMediaSuccessBlock)successBlock +- (void)loadDataWithOptions:(WPMediaLoadOptions)options + success:(WPMediaSuccessBlock)successBlock failure:(WPMediaFailureBlock)failureBlock; -- (void)loadGroupDataWithSuccess:(WPMediaSuccessBlock)successBlock - failure:(WPMediaFailureBlock)failureBlock; - - /** * Requests to the data source to add an image to the library. * diff --git a/Pod/Classes/WPMediaGroupPickerViewController.m b/Pod/Classes/WPMediaGroupPickerViewController.m index 6946103c..038e77cf 100644 --- a/Pod/Classes/WPMediaGroupPickerViewController.m +++ b/Pod/Classes/WPMediaGroupPickerViewController.m @@ -51,7 +51,7 @@ - (void)viewDidLoad - (void)loadData { - [self.dataSource loadGroupDataWithSuccess:^{ + [self.dataSource loadDataWithOptions:WPMediaLoadOptionsGroups success:^{ dispatch_async(dispatch_get_main_queue(), ^{ [self.tableView reloadData]; }); diff --git a/Pod/Classes/WPMediaPickerViewController.m b/Pod/Classes/WPMediaPickerViewController.m index 924ca686..b9949b78 100644 --- a/Pod/Classes/WPMediaPickerViewController.m +++ b/Pod/Classes/WPMediaPickerViewController.m @@ -296,7 +296,7 @@ - (void)refreshDataAnimated:(BOOL)animated __weak __typeof__(self) weakSelf = self; - [self.dataSource loadDataWithSuccess:^{ + [self.dataSource loadDataWithOptions:WPMediaLoadOptionsAssets success:^{ __typeof__(self) strongSelf = weakSelf; BOOL refreshGroupFirstTime = strongSelf.refreshGroupFirstTime; strongSelf.refreshGroupFirstTime = NO; diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index 12b66f0e..3793b8fc 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -101,7 +101,8 @@ - (void)photoLibraryDidChange:(PHChange *)changeInstance }); } -- (void)loadDataWithSuccess:(WPMediaSuccessBlock)successBlock +- (void)loadDataWithOptions:(WPMediaLoadOptions)options + success:(WPMediaSuccessBlock)successBlock failure:(WPMediaFailureBlock)failureBlock { PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus]; @@ -118,23 +119,32 @@ - (void)loadDataWithSuccess:(WPMediaSuccessBlock)successBlock case PHAuthorizationStatusNotDetermined: { [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { - [self loadDataWithSuccess:successBlock failure:failureBlock]; + [self loadDataWithOptions:options success:successBlock failure:failureBlock]; }]; } case PHAuthorizationStatusAuthorized: { dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{ + [[[self class] sharedImageManager] stopCachingImagesForAllAssets]; if (self.activeAssetsCollection == nil) { self.activeAssetsCollection = [[PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:nil] firstObject]; } - if (self.refreshGroups) { - [[[self class] sharedImageManager] stopCachingImagesForAllAssets]; - [self loadGroupsWithSuccess:^{ - self.refreshGroups = NO; - } failure:nil]; + switch (options) { + case (WPMediaLoadOptionsGroups): { + [self loadGroupsWithSuccess:successBlock failure:failureBlock]; + return; + } + case (WPMediaLoadOptionsAssets): { + [self loadAssetsWithSuccess:successBlock failure:failureBlock]; + return; + } + case (WPMediaLoadOptionsGroupsAndAssets): { + [self loadGroupsWithSuccess:^{ + [self loadAssetsWithSuccess:successBlock failure:failureBlock]; + } failure:failureBlock]; + } } - [self loadAssetsWithSuccess:successBlock failure:failureBlock]; }); } } From de78ba9e1e76281dd24875c85df555e8f75588b2 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 22 Aug 2017 15:32:16 +0100 Subject: [PATCH 06/10] Improve code to add collections. --- Pod/Classes/WPPHAssetDataSource.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index 3793b8fc..876928c0 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -123,8 +123,7 @@ - (void)loadDataWithOptions:(WPMediaLoadOptions)options }]; } case PHAuthorizationStatusAuthorized: { - dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{ - [[[self class] sharedImageManager] stopCachingImagesForAllAssets]; + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ if (self.activeAssetsCollection == nil) { self.activeAssetsCollection = [[PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary @@ -213,9 +212,8 @@ - (void)loadGroupsWithSuccess:(WPMediaSuccessBlock)successBlock subtype:PHAssetCollectionSubtypeAny options:nil]; - [self.albums enumerateObjectsUsingBlock:^(PHAssetCollection *collection, NSUInteger index, BOOL *stop){ - [collectionsArray addObject:collection]; - }]; + [collectionsArray addObjectsFromArray:[self.albums objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, self.albums.count)]]]; + PHCollectionList *allAlbums = [PHCollectionList transientCollectionListWithCollections:collectionsArray title:@"Root"]; self.assetsCollections = [PHAssetCollection fetchCollectionsInCollectionList:allAlbums options:nil]; From 3b689e64eb0a754e5191a64cdc82f765149a940e Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 22 Aug 2017 18:21:59 +0100 Subject: [PATCH 07/10] Remove unused method. --- Pod/Classes/WPPHAssetDataSource.m | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index 876928c0..a42ac609 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -149,34 +149,6 @@ - (void)loadDataWithOptions:(WPMediaLoadOptions)options } } -- (void)loadGroupDataWithSuccess:(WPMediaSuccessBlock)successBlock - failure:(WPMediaFailureBlock)failureBlock -{ - PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus]; - switch (status) { - case PHAuthorizationStatusRestricted: - case PHAuthorizationStatusDenied: - { - if (failureBlock) { - NSError *error = [NSError errorWithDomain:WPMediaPickerErrorDomain code:WPMediaErrorCodePermissionsFailed userInfo:nil]; - failureBlock(error); - } - return; - } - case PHAuthorizationStatusNotDetermined: - { - [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { - [self loadGroupDataWithSuccess:successBlock failure:failureBlock]; - }]; - } - case PHAuthorizationStatusAuthorized: { - dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{ - [self loadGroupsWithSuccess:successBlock failure:failureBlock]; - }); - } - } -} - - (NSArray *)smartAlbumsToShow { NSMutableArray *smartAlbumsOrder = [NSMutableArray arrayWithArray:@[ @(PHAssetCollectionSubtypeSmartAlbumUserLibrary), From 079b37d428f65fedf08334aa0e6d35eb860e1b45 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 22 Aug 2017 22:21:34 +0100 Subject: [PATCH 08/10] Make poster asset fetch execute in background. --- Pod/Classes/WPPHAssetDataSource.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/WPPHAssetDataSource.m b/Pod/Classes/WPPHAssetDataSource.m index a42ac609..7f5685e3 100644 --- a/Pod/Classes/WPPHAssetDataSource.m +++ b/Pod/Classes/WPPHAssetDataSource.m @@ -206,6 +206,10 @@ - (void)loadGroupsWithSuccess:(WPMediaSuccessBlock)successBlock } } + + self.albums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum + subtype:PHAssetCollectionSubtypeAny + options:nil]; } + (NSPredicate *)predicateForFilterMediaType:(WPMediaType)mediaType @@ -559,7 +563,10 @@ - (NSString *)name - (WPMediaRequestID)imageWithSize:(CGSize)size completionHandler:(WPMediaImageBlock)completionHandler { - return [self.posterAsset imageWithSize:size completionHandler:completionHandler]; + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ + [self.posterAsset imageWithSize:size completionHandler:completionHandler]; + }); + return 0; } - (void)cancelImageRequest:(WPMediaRequestID)requestID @@ -609,7 +616,7 @@ - (PHFetchResult *)posterAssetFetchResult { - (PHAsset *)posterAsset { if (!_posterAsset) { - _posterAsset = [[self posterAssetFetchResult] lastObject]; + _posterAsset = [[self posterAssetFetchResult] firstObject]; } return _posterAsset; From dbee01f29c8eef723394c3786c4b5e8ca98d0a18 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 22 Aug 2017 23:24:36 +0100 Subject: [PATCH 09/10] No need to dispatch to main queue here. --- Pod/Classes/WPMediaGroupPickerViewController.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Pod/Classes/WPMediaGroupPickerViewController.m b/Pod/Classes/WPMediaGroupPickerViewController.m index 038e77cf..53458879 100644 --- a/Pod/Classes/WPMediaGroupPickerViewController.m +++ b/Pod/Classes/WPMediaGroupPickerViewController.m @@ -42,9 +42,7 @@ - (void)viewDidLoad self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelPicker:)]; __weak __typeof__(self) weakSelf = self; self.changesObserver = [self.dataSource registerChangeObserverBlock:^(BOOL incrementalChanges, NSIndexSet *deleted, NSIndexSet *inserted, NSIndexSet *reload, NSArray *moves) { - dispatch_async(dispatch_get_main_queue(), ^{ - [weakSelf loadData]; - }); + [weakSelf loadData]; }]; [self loadData]; } From a71fb2d29949ab6c42c12539a60312ea7c6ec6cb Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 22 Aug 2017 23:27:39 +0100 Subject: [PATCH 10/10] Configure image view appearance on group cell. --- Example/WPMediaPicker/AppDelegate.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Example/WPMediaPicker/AppDelegate.m b/Example/WPMediaPicker/AppDelegate.m index 1201282f..021f9a80 100644 --- a/Example/WPMediaPicker/AppDelegate.m +++ b/Example/WPMediaPicker/AppDelegate.m @@ -35,6 +35,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( UIColor *cellBackgroundColor = [UIColor colorWithRed:243/255.0f green:246/255.0f blue:248/255.0f alpha:1.0f]; [[WPMediaCollectionViewCell appearanceWhenContainedIn:[WPMediaPickerViewController class],nil] setBackgroundColor:cellBackgroundColor]; [[WPMediaCollectionViewCell appearanceWhenContainedIn:[WPInputMediaPickerViewController class],nil] setBackgroundColor:cellBackgroundColor]; + [[UIImageView appearanceWhenContainedIn:[WPMediaGroupTableViewCell class],nil] setBackgroundColor:cellBackgroundColor]; //Configure color for activity indicator while loading media collection [[UIActivityIndicatorView appearanceWhenContainedIn:[WPMediaPickerViewController class],nil] setColor:[UIColor grayColor]];