<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSPersistentHistoryChangeRequest/deleteHistory(before:)-7t2th",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPersistentHistoryChangeRequest(cm)deleteHistoryBeforeDate:"
  },
  "title" : "deleteHistory(before:)"
}
-->

# deleteHistory(before:)

Purges history older than a given date.

```
class func deleteHistory(before date: Date) -> Self
```

## Parameters

`date`

The date used to define the end of the delete history request.

## Return Value

A delete history change request ([`NSPersistentHistoryChangeRequest`](/documentation/CoreData/NSPersistentHistoryChangeRequest)) using an end date boundary.

---

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)