---
title: TabletopInteraction
framework: tabletopkit
role: symbol
role_heading: Class
path: tabletopkit/tabletopinteraction
---

# TabletopInteraction

A protocol for objects that manage the entire flow of players interacting with equipment.

## Declaration

```swift
class TabletopInteraction
```

## Overview

Overview Conform to the TabletopInteraction.Delegate protocol to take an appropriate action, depending on the equipment and the phase of the interaction. For example, move equipment or toss a die when a gesture ends. struct MoveInteraction: TabletopInteraction.Delegate {     func update(interaction: TabletopKit.TabletopInteraction) {         let equipment = interaction.value.controlledEquipmentID         guard let destination = interaction.value.proposedDestination else {             return         }                  if interaction.value.phase == .ended {             interaction.addAction(.moveEquipment(matching: equipment, childOf: destination.equipmentID, pose: destination.pose))         }     } } To get information about the equipment that the interaction applies to, use the value property. To get the phase of the interaction or gesture, use the Value gesturePhase or phase properties. Then execute actions — for example, move equipment when the phase ends — using the addAction(_:) or addActions(_:) method. To start an interaction programmatically, use the TabletopGame startInteraction(onEquipmentID:) method.

## Topics

### Performing actions

- [TabletopInteraction.Delegate](tabletopkit/tabletopinteraction/delegate.md)
- [TabletopInteraction.TossOutcome](tabletopkit/tabletopinteraction/tossoutcome.md)
- [addAction(_:)](tabletopkit/tabletopinteraction/addaction(_:)-1cety.md)
- [addAction(_:)](tabletopkit/tabletopinteraction/addaction(_:)-4rx16.md)
- [addActions(_:)](tabletopkit/tabletopinteraction/addactions(_:).md)
- [toss(equipmentID:as:linearVelocity:angularVelocity:)](tabletopkit/tabletopinteraction/toss(equipmentid:as:linearvelocity:angularvelocity:).md)
- [end()](tabletopkit/tabletopinteraction/end().md)
- [cancel()](tabletopkit/tabletopinteraction/cancel().md)

### Getting the value of the interaction

- [value](tabletopkit/tabletopinteraction/value-swift.property.md)
- [TabletopInteraction.Value](tabletopkit/tabletopinteraction/value-swift.struct.md)

### Setting information about the equipment and pose

- [setControlledEquipment(matching:)](tabletopkit/tabletopinteraction/setcontrolledequipment(matching:).md)
- [setPose(_:)](tabletopkit/tabletopinteraction/setpose(_:).md)

### Managing the interaction destination

- [setConfiguration(_:)](tabletopkit/tabletopinteraction/setconfiguration(_:).md)
- [TabletopInteraction.Configuration](tabletopkit/tabletopinteraction/configuration.md)
- [TabletopInteraction.AllowedDestinations](tabletopkit/tabletopinteraction/alloweddestinations.md)
- [TabletopInteraction.Destination](tabletopkit/tabletopinteraction/destination.md)
- [setAllowedDestinations(_:)](tabletopkit/tabletopinteraction/setalloweddestinations(_:).md)

### Getting the interaction identifier

- [TabletopInteraction.Identifier](tabletopkit/tabletopinteraction/identifier.md)

### Determining the dead zone

- [TabletopInteraction.DeadZone](tabletopkit/tabletopinteraction/deadzone.md)

### Handling collision behavior

- [TabletopInteraction.Constants](tabletopkit/tabletopinteraction/constants.md)
- [TabletopInteraction.CollisionTargets](tabletopkit/tabletopinteraction/collisiontargets.md)
- [TabletopInteraction.DirectPickupBehavior](tabletopkit/tabletopinteraction/directpickupbehavior.md)
- [TabletopInteraction.DirectInteractionConstants](tabletopkit/tabletopinteraction/directinteractionconstants.md)
- [TabletopInteraction.IndirectRotationAlignmentBehavior](tabletopkit/tabletopinteraction/indirectrotationalignmentbehavior.md)
- [TabletopInteraction.IndirectInteractionConstants](tabletopkit/tabletopinteraction/indirectinteractionconstants.md)
- [TabletopInteraction.HoverAlignmentBehavior](tabletopkit/tabletopinteraction/hoveralignmentbehavior.md)
- [TabletopInteraction.HoverAlignmentSource](tabletopkit/tabletopinteraction/hoveralignmentsource.md)
- [TabletopInteraction.ProgrammaticInteractionConstants](tabletopkit/tabletopinteraction/programmaticinteractionconstants.md)

### Handling interaction intents

- [TabletopInteraction.NewInteractionIntent](tabletopkit/tabletopinteraction/newinteractionintent.md)
- [TabletopInteraction.NewDirectInteractionIntent](tabletopkit/tabletopinteraction/newdirectinteractionintent.md)
- [TabletopInteraction.NewIndirectInteractionIntent](tabletopkit/tabletopinteraction/newindirectinteractionintent.md)

## See Also

### Interactions

- [Simulating dice rolls as a component for your game](tabletopkit/simulating-dice-rolls-as-a-component-for-your-game.md)
- [TossableRepresentation](tabletopkit/tossablerepresentation.md)
- [TableSnapshot](tabletopkit/tablesnapshot.md)
- [TableVisualState](tabletopkit/tablevisualstate.md)
- [TableCursor](tabletopkit/tablecursor.md)
- [TableCursorIdentifier](tabletopkit/tablecursoridentifier.md)
