<!--
{
  "availability" : [
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabletopKit",
  "identifier" : "/documentation/TabletopKit/UpdateCounterAction",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "TabletopKit"
    ],
    "preciseIdentifier" : "s:11TabletopKit19UpdateCounterActionV"
  },
  "title" : "UpdateCounterAction"
}
-->

# UpdateCounterAction

An action that updates the game counter.

```
struct UpdateCounterAction
```

## Overview

To create an update counter action, use the [`updateCounter(_:context:)`](/documentation/TabletopKit/TabletopAction/updateCounter(_:context:)) or the [`updateCounter(matching:value:context:)`](/documentation/TabletopKit/TabletopAction/updateCounter(matching:value:context:)) static method.

## Topics

### Getting counter information

[`var counterID: ScoreCounter.Identifier`](/documentation/TabletopKit/UpdateCounterAction/counterID)

The ID of the counter to update.

[`var newValue: Int64`](/documentation/TabletopKit/UpdateCounterAction/newValue)

The new value to set for the counter.

### Getting game-specific information

[`var context: UInt64`](/documentation/TabletopKit/UpdateCounterAction/context)

An integer value that your game uses.

### Getting the player identifier

[`var playerID: Player.ID?`](/documentation/TabletopKit/UpdateCounterAction/playerID)

The ID of the player who is updating the counter.

## Relationships

### Conforms To

[`TabletopAction`](/documentation/TabletopKit/TabletopAction)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

---

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)