I'm using Objective-C, iOS 10 and iPad. I know how to get the list of albums made by an artist.
MPMediaQuery *albums=[MPMediaQuery albumsQuery];
MPMediaPropertyPredicate *artistName=[MPMediaPropertyPredicate predicateWithValue: @"some name" forProperty: MPMediaItemPropertyAlbumArtist];
[albums addFilterPredicate:artistName];
NSArray *albumsArray=albums.collections;
for(MPMediaItemCollection *albumCollection in albumsArray){
NSString *albumTitle=[[albumCollection representativeItem] valueForProperty:MPMediaItemPropertyAlbumTitle];
NSLog(@"%@",albumTitle);
}
The albumsQuery provided by Apple is sorted by album name.
I need to sort the albums by year.