---
title: allowEvaluation()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nspredicate/allowevaluation()
---

# allowEvaluation()

Forces a securely decoded predicate to allow evaluation.

## Declaration

```swift
func allowEvaluation()
```

## Discussion

Discussion When securely decoding NSPredicate objects that are encoded using NSSecureCoding, evaluation is disabled because it is potentially unsafe to evaluate predicates you get out of an archive. Before you enable evaluation, you should validate key paths, selectors, and other details to ensure no erroneous or malicious code will be executed. Once you’ve verified the predicate, you can enable the receiver for evaluation by calling allowEvaluation().

## See Also

### Evaluating a Predicate

- [evaluate(with:)](foundation/nspredicate/evaluate(with:).md)
- [evaluate(with:substitutionVariables:)](foundation/nspredicate/evaluate(with:substitutionvariables:).md)
