<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPMediaItem/titleProperty(forGroupingType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Media Player",
      "MediaPlayer"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMediaItem(cm)titlePropertyForGroupingType:"
  },
  "title" : "titleProperty(forGroupingType:)"
}
-->

# titleProperty(forGroupingType:)

Obtains the title key for a specified grouping type.

```
class func titleProperty(forGroupingType groupingType: MPMediaGrouping) -> String
```

## Parameters

`groupingType`

The grouping type that you want the title key for.

## Return Value

The title key for the group type.

## Discussion

Use this convenience method to obtain the key for the title that corresponds to a specified grouping type. For example, the following statement obtains the title key for the album grouping type:

```objc
NSString *titleIDKey = [MPMediaItem titlePropertyForGroupingType: MPMediaGroupingAlbum];
```

You could then obtain the specific title that you want by using the [`value(forProperty:)`](/documentation/MediaPlayer/MPMediaEntity/value(forProperty:)) method. [`MPMediaGrouping`](/documentation/MediaPlayer/MPMediaGrouping) describes grouping 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)