<!--
{
  "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/subscript(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMediaEntity(im)objectForKeyedSubscript:"
  },
  "title" : "subscript(_:)"
}
-->

# subscript(_:)

Returns the object specified by the key.

```
subscript(key: Any) -> Any? { get }
```

## Parameters

`key`

The key associated with the retrieved object.

## Return Value

The object that is specified by the key.

## Discussion

The method provides read-only support for Objective-C subscripting syntax with [`MPMediaEntity`](/documentation/MediaPlayer/MPMediaEntity) property constants.

---

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)