init(fetchDescriptor:sectionBy:modelContainer:isolation:)
Creates a new observer with the given fetch descriptor, a String section key path, and a model container.
Declaration
convenience init(fetchDescriptor: FetchDescriptor<Element> = FetchDescriptor<Element>(), sectionBy: KeyPath<Element, String>, modelContainer: ModelContainer, isolation: isolated (any Actor)? = #isolation) throwsParameters
- fetchDescriptor:
The descriptor defining the fetch criteria.
- sectionBy:
A key path on the element type that returns the section name.
- modelContainer:
The model container from which a new context will be created.
Discussion
A new ModelContext is created from the provided container.