Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 322aff1

Browse files
committed
Sort user albums alphabeticaly
1 parent 567cdc6 commit 322aff1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)