<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPMediaEntity/value(forProperty:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMediaEntity(im)valueForProperty:"
  },
  "title" : "value(forProperty:)"
}
-->

# value(forProperty:)

Retrieves the value for a specified media property key.

```
func value(forProperty property: String) -> Any?
```

## Parameters

`property`

The media property key that you want the corresponding value of.

## Return Value

The value for the media `property` key.

## Discussion

Use [`enumerateValues(forProperties:using:)`](/documentation/MediaPlayer/MPMediaEntity/enumerateValues(forProperties:using:)) to efficiently access more than one property at a time.

To see which media property keys you can use with this method, refer to [Media entity property keys](/documentation/MediaPlayer/media-entity-property-keys), [General media item property keys](/documentation/MediaPlayer/general-media-item-property-keys), [Playlist property keys](/documentation/MediaPlayer/playlist-property-keys), and [User-defined property keys](/documentation/MediaPlayer/user-defined-property-keys).

---

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)