Contents

init(block:)

Creates a predicate that evaluates using a specified block object and bindings dictionary.

Declaration

init(block: @escaping (Any?, [String : Any]?) -> Bool)

Parameters

  • block:

    The block is applied to the object to be evaluated.

    The block takes two arguments:

    evaluatedObject

    The object to be evaluated.

    bindings

    The substitution variables dictionary. The dictionary must contain key-value pairs for all variables in the receiver.

    The block returns True if the evaluatedObject evaluates to true, otherwise False.

Return Value

A new predicate by that evaluates objects using block.

Discussion

In macOS 10.6 and later, Core Data supports block-based predicates in the in-memory and atomic stores, but not in the SQLite-based store.

See Also

Creating a Predicate