Type Method

songs()

Creates a media query that matches music items and that groups and sorts collections by song name.

Declaration

class func songs() -> MPMediaQuery

Return Value

A media query that matches media items of type music and has a grouping type of MPMediaGrouping.title.

Discussion

A media item can have more than one media type; for example, an item could be of types “music” and “podcast.” A songs() query matches all music items, whether or not they are also of other media types.

See Also

Creating Media Queries

class func albums() -> MPMediaQuery

Creates a media query that matches music items and that groups and sorts collections by album name.

class func artists() -> MPMediaQuery

Creates a media query that matches music items and that groups and sorts collections by artist name.

class func playlists() -> MPMediaQuery

Creates a media query that matches the entire library and that groups and sorts collections by playlist name.

class func podcasts() -> MPMediaQuery

Creates a media query that matches podcast items and that groups and sorts collections by podcast name.

class func audiobooks() -> MPMediaQuery

Creates a media query that matches audio book items and that groups and sorts collections by audio book name.

class func compilations() -> MPMediaQuery

Creates a media query that matches compilation items and that groups and sorts collections by album name.

class func composers() -> MPMediaQuery

Creates a media query that matches all media items and that groups and sorts collections by composer name.

class func genres() -> MPMediaQuery

Creates a media query that matches all media items and that groups and sorts collections by genre name.

init(filterPredicates: Set<MPMediaPredicate>?)

Initializes a media query with a set of media property predicates.