<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "swift: 5.9.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/ModelContext/NotificationKey",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData12ModelContextC15NotificationKeyO"
  },
  "title" : "ModelContext.NotificationKey"
}
-->

# ModelContext.NotificationKey

Describes the data in the user info dictionary of a notification sent by a model context.

```
enum NotificationKey
```

## Topics

### Accessing notification keys

[`case deletedIdentifiers`](/documentation/SwiftData/ModelContext/NotificationKey/deletedIdentifiers)

A set of values identifying the context’s deleted models.

[`case insertedIdentifiers`](/documentation/SwiftData/ModelContext/NotificationKey/insertedIdentifiers)

A set of values identifying the context’s inserted models.

[`case invalidatedAllIdentifiers`](/documentation/SwiftData/ModelContext/NotificationKey/invalidatedAllIdentifiers)

A set of values identifying the context’s invalidated models.

[`case updatedIdentifiers`](/documentation/SwiftData/ModelContext/NotificationKey/updatedIdentifiers)

A set of values identifying the context’s updated models.

[`case queryGeneration`](/documentation/SwiftData/ModelContext/NotificationKey/queryGeneration)

A token that indicates which generation of the model store SwiftData is using.

[`case historyTokens`](/documentation/SwiftData/ModelContext/NotificationKey/historyTokens)

A history token representing the persistent store state after the save.

### Creating a notification key

## Relationships

### Conforms To

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Hashable`](/documentation/Swift/Hashable)

[`Escapable`](/documentation/Swift/Escapable)

[`Equatable`](/documentation/Swift/Equatable)

[`Copyable`](/documentation/Swift/Copyable)

---

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)