Contents

withSubstitutionVariables(_:)

Returns a copy of the predicate and substitutes the predicates variables with specified values from a specified substitution variables dictionary.

Declaration

func withSubstitutionVariables(_ variables: [String : Any]) -> Self

Parameters

  • variables:

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

Return Value

A copy of the receiver with the predicate’s variables substituted by values specified in variables.

Discussion

The predicate itself is not modified by this method, so you can reuse it for any number of substitutions.

See Also

Creating a Predicate