Skip to content

Commit c29356c

Browse files
Merge pull request #329 from wordpress-mobile/issue/sort-user-albums
Sort user albums alphabetically
2 parents 567cdc6 + c96e08c commit c29356c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- WPMediaPicker (1.4.1-beta.1)
2+
- WPMediaPicker (1.4.1)
33

44
DEPENDENCIES:
55
- WPMediaPicker (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
WPMediaPicker: c6873fefaee96c4cae808a3e9401f50ee694075e
12+
WPMediaPicker: 8cff8dff846f3440c0c6d088c12240ab85570ee5
1313

1414
PODFILE CHECKSUM: 7c47e10b39aca62b1f30c3c4260cc99456cf95f8
1515

Pod/Classes/WPPHAssetDataSource.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,10 @@ - (void)loadGroupsWithSuccess:(WPMediaSuccessBlock)successBlock
214214

215215
PHFetchOptions *albumOptions = [[PHFetchOptions alloc] init];
216216
albumOptions.predicate = [NSPredicate predicateWithFormat:@"(estimatedAssetCount != 0)"];
217+
albumOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"localizedTitle" ascending:YES]];
217218
self.albums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum
218219
subtype:PHAssetCollectionSubtypeAny
219-
options:nil];
220+
options:albumOptions];
220221

221222
[collectionsArray addObjectsFromArray:[self.albums objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, self.albums.count)]]];
222223

0 commit comments

Comments
 (0)