Contents

init(filterBy:sortBy:modelContext:isolation:)

Creates a new unsectioned observer with individual filter and sort criteria and a model context.

Declaration

convenience init(filterBy: Predicate<Element>? = nil, sortBy: [SortDescriptor<Element>]? = nil, modelContext: ModelContext, isolation: isolated (any Actor)? = #isolation) throws

Parameters

  • filterBy:

    An optional predicate to filter the results.

  • sortBy:

    An optional array of sort descriptors to order the results.

  • modelContext:

    The model context to fetch from and observe for changes.

Discussion

See Also

Creating a results observer with a predicate