<!--
{
  "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:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMediaPropertyPredicate(cm)predicateWithValue:forProperty:"
  },
  "title" : "init(value:forProperty:)"
}
-->

# init(value:forProperty:)

Creates a media property predicate with the default comparison type.

```
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`](/documentation/MediaPlayer/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 Media item types and keys.

## Return Value

A media property predicate.

## Discussion

This is a convenience method that uses the default logical comparison type of [`MPMediaPredicateComparison.equalTo`](/documentation/MediaPlayer/MPMediaPredicateComparison/equalTo).

---

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)