init(filterBy:sortBy:sectionBy:modelContainer:isolation:)
Creates a new observer with individual filter and sort criteria, a String section key path, and a model container.
Declaration
convenience init(filterBy: Predicate<Element>? = nil, sortBy: [SortDescriptor<Element>]? = nil, sectionBy: KeyPath<Element, String>, modelContainer: ModelContainer, isolation: isolated (any Actor)? = #isolation) throwsParameters
- filterBy:
An optional predicate to filter the results.
- sortBy:
An optional array of sort descriptors to order the results.
- 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.