<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPMediaPropertyPredicate/init(value:forProperty:comparisonType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMediaPropertyPredicate(cm)predicateWithValue:forProperty:comparisonType:"
  },
  "title" : "init(value:forProperty:comparisonType:)"
}
-->

# init(value:forProperty:comparisonType:)

Creates a media property predicate with a specified comparison type.

```
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 [`MPMediaItem`](/documentation/MediaPlayer/MPMediaItem).

`comparisonType`

: The logical comparison type for the predicate. See [`MPMediaPredicateComparison`](/documentation/MediaPlayer/MPMediaPredicateComparison).

## Return Value

A media property predicate.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)