Contents

init(fetchDescriptor:sectionBy:modelContainer:isolation:)

Creates a new observer with the given fetch descriptor, an optional 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) throws

Parameters

  • fetchDescriptor:

    The descriptor defining the fetch criteria.

  • sectionBy:

    A key path on the element type that returns an optional section name.

  • modelContainer:

    The model container from which a new context will be created.

Discussion

See Also

Creating a results observer with a fetch descriptor