<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/FetchRequest/init(fetchRequest:transaction:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI12FetchRequestV05fetchD011transactionACyxGSo07NSFetchD0CyxG_AA11TransactionVtcfc"
  },
  "title" : "init(fetchRequest:transaction:)"
}
-->

# init(fetchRequest:transaction:)

Creates a fully configured fetch request that uses the specified
transaction when updating results.

```
@MainActor @preconcurrency init(fetchRequest: NSFetchRequest<Result>, transaction: Transaction)
```

## Parameters

`fetchRequest`

An
<doc://com.apple.documentation/documentation/CoreData/NSFetchRequest>
instance that describes the search criteria for retrieving data
from the persistent store.

`transaction`

A transaction to use for user interface changes that
result from changes to the fetched results.

## Discussion

Use this initializer if you need a fetch request with updates that
affect the user interface based on a [`Transaction`](/documentation/SwiftUI/Transaction). Otherwise, use
[`init(fetchRequest:animation:)`](/documentation/SwiftUI/FetchRequest/init(fetchRequest:animation:)).

---

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)