---
title: "evaluatePredicate(in:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkrule/evaluatepredicate(in:)"
---

# evaluatePredicate(in:)

Returns a Boolean value indicating whether the rule has been satisfied in the context of the specified rule system.

## Declaration

```swift
func evaluatePredicate(in system: GKRuleSystem) -> Bool
```

## Return Value

Return Value true if the rule is satisfied (and its action should be executed); otherwise, false.

## Discussion

Discussion A rule system calls this method when evaluating its rules. If the rule was created with the init(predicate:assertingFact:grade:) or init(predicate:retractingFact:grade:), calling this method returns the result of testing the predicate against the provided rule system. If the rule was created with the init(blockPredicate:action:) method, calling this method calls the predicate block and returns the result. Otherwise, this method always returns false—subclasses should override this method to implement their own predicate tests.

## See Also

### Evaluating a Rule

- [performAction(in:)](gameplaykit/gkrule/performaction(in:).md)
