Initializer

init(filterPredicates:)

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

Declaration

init(filterPredicates: Set<MPMediaPredicate>?)

Parameters

filterPredicates

The set of media property predicates to use as a filter on the library.

Return Value

An initialized media query.

Discussion

MPMediaPropertyPredicate describes how to create media property predicates. The General Media Item Property Keys and Podcast Item Property Keys enumerations in MPMediaItem contain the keys you can use to construct predicates.

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 songs() -> MPMediaQuery

Creates a media query that matches music items and that groups and sorts collections by song 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.