compilations()
Creates a media query that matches compilation items and that groups and sorts collections by album name.
Declaration
class func compilations() -> MPMediaQueryReturn Value
A media query that matches any media item that has the MPMediaItemPropertyIsCompilation property; the returned query has a grouping type of MPMediaGrouping.album.
Discussion
A media item can have more than one media type; for example, an item could be of types “music” and “podcast.” A compilations() query matches all media items that have the MPMediaItemPropertyIsCompilation property, irrespective of their media types.