<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/PersistentIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData20PersistentIdentifierV"
  },
  "title" : "PersistentIdentifier"
}
-->

# PersistentIdentifier

A type that describes the aggregate identity of a SwiftData model.

```
struct PersistentIdentifier
```

## Overview> Note: Decoded ``doc://com.apple.SwiftData/documentation/SwiftData/PersistentIdentifier`` and identifiers created by the ``doc://com.apple.SwiftData/documentation/SwiftData/DefaultStore`` are not considered equivalent.

## Topics

### Accessing identity information

[`id`](/documentation/SwiftData/PersistentIdentifier/id-swift.property)

The value that uniquely identifies the associated model within the containing store.

[`PersistentIdentifier.ID`](/documentation/SwiftData/PersistentIdentifier/ID-swift.struct)

A type that represents the stable identity of a SwiftData model.

[`storeIdentifier`](/documentation/SwiftData/PersistentIdentifier/storeIdentifier)

The identifier of the store that contains the associated model.

[`entityName`](/documentation/SwiftData/PersistentIdentifier/entityName)

The entity name for the associated model.

### Encoding and decoding

### Hashing

### Comparing identifiers



---

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)