<!--
{
  "availability" : [
    "iOS: 7.1.0 -",
    "iPadOS: 7.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.2 -",
    "tvOS: 7.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPContentItem/init(identifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPContentItem(im)initWithIdentifier:"
  },
  "title" : "init(identifier:)"
}
-->

# init(identifier:)

Sets the identifier for a media item.

```
init(identifier: String)
```

## Parameters

`identifier`

A unique identifier for the content item.

## Return Value

The created `MPContentItem` object.

## Discussion

Each media item identifier must be unique. The use of nonunique identifiers can prevent media items from updating properly. Create a new identifier when creating an `MPContentItem` object.

---

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)