handlesGameControllerEvents(matching:withOptions:)
Specifies the game controllers events which should be delivered through the GameController framework when the view or one of its descendants has focus.
Declaration
nonisolated func handlesGameControllerEvents(matching types: GCUIEventTypes, withOptions options: GameControllerEventHandlingOptions?) -> some View
Discussion
SpriteView(scene: MyGameScene())
.handlesGameControllerEvents(matching: .gamepad, withOptions: .defaultOptions)
.focused(true)