<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "swift: 5.9.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/HistoryProviding",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData16HistoryProvidingP"
  },
  "title" : "HistoryProviding"
}
-->

# HistoryProviding

An interface that enables a custom data store to provide the history of changes
for its persisted models.

```
protocol HistoryProviding
```

## Topics

### Processing history fetch requests

[`func fetchHistory(HistoryDescriptor<Self.HistoryType>) throws -> [Self.HistoryType]`](/documentation/SwiftData/HistoryProviding/fetchHistory(_:))

### Deleting history

[`func deleteHistory(HistoryDescriptor<Self.HistoryType>) throws`](/documentation/SwiftData/HistoryProviding/deleteHistory(_:))

### Getting the history transaction type

[`associatedtype HistoryType : HistoryTransaction`](/documentation/SwiftData/HistoryProviding/HistoryType-swift.associatedtype)

### Type Properties

[`static var historyType: Self.HistoryType.Type`](/documentation/SwiftData/HistoryProviding/historyType-swift.type.property)

## Relationships

### Conforming Types

[`DefaultStore`](/documentation/SwiftData/DefaultStore)

---

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)