Initializer

init(value:forProperty:)

Creates a media property predicate with the default comparison type.

Declaration

init(value: Any?, forProperty property: String)

Parameters

value

The property value that you want to match when you query the Music library. For example, if you specify the MPMediaItemPropertyArtist constant in the forProperty parameter, in this parameter you supply a string containing the artist name.

property

A property that can be used to build a media property predicate. See General Media Item Property Keys and Podcast Item Property Keys in MPMediaItem.

Return Value

A media property predicate.

Discussion

This is a convenience method that uses the default logical comparison type of MPMediaPredicateComparison.equalTo.

See Also

Creating Media Property Predicates

init(value: Any?, forProperty: String, comparisonType: MPMediaPredicateComparison)

Creates a media property predicate with a specified comparison type.