<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSPredicate/evaluate(with:substitutionVariables:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPredicate(im)evaluateWithObject:substitutionVariables:"
  },
  "title" : "evaluate(with:substitutionVariables:)"
}
-->

# evaluate(with:substitutionVariables:)

Returns a Boolean value that indicates whether the specified object matches the conditions that the predicate specifies after substituting in the values from a specified variables dictionary.

```
func evaluate(with object: Any?, substitutionVariables bindings: [String : Any]?) -> Bool
```

## Parameters

`object`

The object against which to evaluate the predicate.

`bindings`

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

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if `object` matches the conditions specified by the predicate after substituting in the values in `bindings` for any replacement tokens, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method returns the same result as the two step process of first invoking [`withSubstitutionVariables(_:)`](/documentation/Foundation/NSPredicate/withSubstitutionVariables(_:)) on the predicate and then invoking [`evaluate(with:)`](/documentation/Foundation/NSPredicate/evaluate(with:)) on the returned value. This method is optimized for situations which require repeatedly evaluating a predicate with substitution variables with different variable substitutions.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)