<!--
{
  "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/performAction(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKRule(im)performActionWithSystem:"
  },
  "title" : "performAction(in:)"
}
-->

# performAction(in:)

Performs actions that should result when the rule is satisfied in the context of the specified rule system.

```
func performAction(in system: GKRuleSystem)
```

## Discussion

A rule system calls this method when evaluating its rules, if and only if the rule’s predicate has been satisfied (that is, the [`evaluatePredicate(in:)`](/documentation/GameplayKit/GKRule/evaluatePredicate(in:)) method has returned <doc://com.apple.documentation/documentation/Swift/true>), and after moving the rule from its [`agenda`](/documentation/GameplayKit/GKRuleSystem/agenda) list to its [`executed`](/documentation/GameplayKit/GKRuleSystem/executed) list.

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 asserts or retracts the fact as specified in 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 action block. Otherwise, this method does nothing—subclasses should override this method to implement their own actions.

---

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)