---
title: "fetchHistory(withFetch:)"
framework: coredata
role: symbol
role_heading: Type Method
path: "coredata/nspersistenthistorychangerequest/fetchhistory(withfetch:)"
---

# fetchHistory(withFetch:)

Retrieves history based on a fetch request.

## Declaration

```swift
class func fetchHistory(withFetch fetchRequest: NSFetchRequest<any NSFetchRequestResult>) -> Self
```

## Parameters

- `fetchRequest`: The fetch request that defines the history bounds.

## Return Value

Return Value A persistent history fetch request (NSPersistentHistoryChangeRequest) built using an existing fetch request.

## See Also

### Fetching History

- [fetchHistory(after:)](coredata/nspersistenthistorychangerequest/fetchhistory(after:)-qi5b.md)
- [fetchHistory(after:)](coredata/nspersistenthistorychangerequest/fetchhistory(after:)-3rmfm.md)
- [fetchHistory(after:)](coredata/nspersistenthistorychangerequest/fetchhistory(after:)-9cuj5.md)
