Contents

GCEventInteraction

An interaction that indicates the view’s intent to receive game controller events through the Game Controller framework.

Declaration

class GCEventInteraction

Mentioned in

Overview

On visionOS, users can interact with your app using a game controller. By default, the system converts game controller actions into pinch events and sends them to the view the user is gazing at, its gesture recognizers, and then up the responder chain.

If you use the Game Controller framework to handle game controller events for part of your user interface, add an instance of GCEventInteraction to the root of that part of your app’s view hierarchy. For example, if you are writing a game using Metal, add this interaction to the view that hosts your game’s CAMetalLayer.

Topics

Creating an interaction

Receiving view events

Getting the event types

See Also

Responding to a paused controller or controller event