<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKRule/evaluatePredicate(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKRule(im)evaluatePredicateWithSystem:"
  },
  "title" : "evaluatePredicate(in:)"
}
-->

# evaluatePredicate(in:)

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

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

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the rule is satisfied (and its action should be executed); otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

A rule system calls this method when evaluating its rules.

If the rule was created with the [`init(predicate:assertingFact:grade:)`](/documentation/GameplayKit/GKRule/init(predicate:assertingFact:grade:)) or [`init(predicate:retractingFact:grade:)`](/documentation/GameplayKit/GKRule/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:)`](/documentation/GameplayKit/GKRule/init(blockPredicate:action:)) method, calling this method calls the predicate block and returns the result. Otherwise, this method always returns <doc://com.apple.documentation/documentation/Swift/false>—subclasses should override this method to implement their own predicate tests.

---

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)