Initializer

init(block:)

Creates and returns 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 OS X v10.6, Core Data supports this method in the in-memory and atomic stores, but not in the SQLite-based store.