---
title: "init(value:forProperty:comparisonType:)"
framework: mediaplayer
role: symbol
role_heading: Initializer
path: "mediaplayer/mpmediapropertypredicate/init(value:forproperty:comparisontype:)"
---

# init(value:forProperty:comparisonType:)

Creates a media property predicate with a specified comparison type.

## Declaration

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

## 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 to use to build a media property predicate. See General Media Item Property Keys and Podcast Item Property Keys in doc://com.apple.mediaplayer/documentation/MediaPlayer/MPMediaItem.
- `comparisonType`: : The logical comparison type for the predicate. See doc://com.apple.mediaplayer/documentation/MediaPlayer/MPMediaPredicateComparison.

## Return Value

Return Value A media property predicate.

## See Also

### Creating media property predicates

- [init(value:forProperty:)](mediaplayer/mpmediapropertypredicate/init(value:forproperty:).md)
