Contents

Query(_:transaction:)

Fetches only the subset of the attached model type that satisfy the provided fetch descriptor’s criteria.

Declaration

@attached(accessor) @attached(peer, names: prefixed(`_`)) macro Query<Element>(_ descriptor: FetchDescriptor<Element>, transaction: Transaction? = nil) where Element : PersistentModel

Parameters

  • descriptor:

    The criteria, sort order, and any additional configuration to use when performing the fetch.

  • transaction:

    The animation to use when updates to the fetched models trigger user interface changes.

See Also

Descriptor-based queries