init(fetchRequest:sectionIdentifier:transaction:)
Creates a fully configured sectioned fetch request that uses the specified transaction when updating results.
Declaration
@MainActor @preconcurrency init(fetchRequest: NSFetchRequest<Result>, sectionIdentifier: KeyPath<Result, SectionIdentifier>, transaction: Transaction)Parameters
- fetchRequest:
An Nsfetchrequest instance that describes the search criteria for retrieving data from the persistent store.
- sectionIdentifier:
A key path that SwiftUI applies to the
Resulttype to get an object’s section identifier. - 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. Otherwise, use init(fetchRequest:sectionIdentifier:animation:).