---
title: GCController
framework: gamecontroller
role: symbol
role_heading: Class
path: gamecontroller/gccontroller
---

# GCController

A representation of a real game controller, a virtual controller, or a snapshot of a controller.

## Declaration

```swift
class GCController
```

## Mentioned in

Adding virtual controls to games that support game controllers in iOS Discovering game controllers Handling input events Discovering and tracking spatial game controllers and styli

## Overview

Overview This class represents a real or virtual controller that a user interacts with during a game. A real controller is a physical controller that connects directly or wirelessly to the device. A real controller can be formfitting or can attach closely to a device so players can use controls on both simultaneously. A virtual controller is a software emulation of a real controller. You discover controllers, and then you process the input from those controllers during gameplay. Use the controllers() method to get the currently connected controllers. If necessary, use the startWirelessControllerDiscovery(completionHandler:) method to connect with wireless controllers. This framework supports multiple connected game controllers. To identify which player is using a controller in a multiplayer game, check the playerIndex property and set it, if necessary. For single-player games, use the current property to get the controller that the player is actively using. A controller’s profile encapsulates the details about a controller’s buttons, pads, axis, and other input elements. Get the controller’s profile using one of the profile properties, such as extendedGamepad, and then process the input from its elements. You can either get the values of input elements on each iteration of your game loop, or set handlers to receive callbacks when those values change. For example, use the leftThumbstick property of the GCExtendedGamepad profile to get the thumbstick state. Use the valueChangedHandler property to set a handler that you implement to process any input values that change in the profile. Alternatively, you can create a snapshot of a real or virtual controller using the capture() method. A snapshot is a copy of a controller at a moment in time with its current element values. Creating a snapshot may impact performance, and over time a snapshot doesn’t stay current. Unlike other types of controllers, you can set the values of elements in a snapshot.

## Topics

### Discovering controllers

- [controllers()](gamecontroller/gccontroller/controllers().md)
- [startWirelessControllerDiscovery(completionHandler:)](gamecontroller/gccontroller/startwirelesscontrollerdiscovery(completionhandler:).md)
- [stopWirelessControllerDiscovery()](gamecontroller/gccontroller/stopwirelesscontrollerdiscovery().md)
- [GCControllerDidConnect](foundation/nsnotification/name-swift.struct/gccontrollerdidconnect.md)
- [GCControllerDidDisconnect](foundation/nsnotification/name-swift.struct/gccontrollerdiddisconnect.md)

### Handling multiple controllers

- [current](gamecontroller/gccontroller/current.md)
- [GCControllerDidBecomeCurrent](foundation/nsnotification/name-swift.struct/gccontrollerdidbecomecurrent.md)
- [GCControllerDidStopBeingCurrent](foundation/nsnotification/name-swift.struct/gccontrollerdidstopbeingcurrent.md)

### Inspecting a controller

- [isAttachedToDevice](gamecontroller/gccontroller/isattachedtodevice.md)
- [supportsHIDDevice(_:)](gamecontroller/gccontroller/supportshiddevice(_:).md)
- [shouldMonitorBackgroundEvents](gamecontroller/gccontroller/shouldmonitorbackgroundevents.md)

### Accessing controller input

- [input](gamecontroller/gccontroller/input.md)
- [GCControllerLiveInput](gamecontroller/gccontrollerliveinput.md)
- [GCControllerInputState](gamecontroller/gccontrollerinputstate.md)

### Accessing controller profiles

- [extendedGamepad](gamecontroller/gccontroller/extendedgamepad.md)
- [GCPhysicalInputProfile](gamecontroller/gcphysicalinputprofile.md)
- [GCKeyboardInput](gamecontroller/gckeyboardinput.md)
- [GCMouseInput](gamecontroller/gcmouseinput.md)
- [GCExtendedGamepad](gamecontroller/gcextendedgamepad.md)
- [GCDualShockGamepad](gamecontroller/gcdualshockgamepad.md)
- [GCXboxGamepad](gamecontroller/gcxboxgamepad.md)
- [GCDualSenseGamepad](gamecontroller/gcdualsensegamepad.md)
- [microGamepad](gamecontroller/gccontroller/microgamepad.md)
- [GCMicroGamepad](gamecontroller/gcmicrogamepad.md)
- [GCDirectionalGamepad](gamecontroller/gcdirectionalgamepad.md)
- [motion](gamecontroller/gccontroller/motion.md)
- [physicalInputProfile](gamecontroller/gccontroller/physicalinputprofile.md)
- [gamepad](gamecontroller/gccontroller/gamepad.md)

### Accessing controller elements

- [GCControllerElement](gamecontroller/gccontrollerelement.md)
- [GCControllerAxisInput](gamecontroller/gccontrolleraxisinput.md)
- [GCControllerButtonInput](gamecontroller/gccontrollerbuttoninput.md)
- [GCControllerTouchpad](gamecontroller/gccontrollertouchpad.md)
- [GCControllerDirectionPad](gamecontroller/gccontrollerdirectionpad.md)
- [GCDeviceCursor](gamecontroller/gcdevicecursor.md)
- [GCDualSenseAdaptiveTrigger](gamecontroller/gcdualsenseadaptivetrigger.md)

### Identifying controllers and displaying a player index

- [playerIndex](gamecontroller/gccontroller/playerindex.md)
- [GCControllerPlayerIndex](gamecontroller/gccontrollerplayerindex.md)

### Accessing battery, haptics, and light objects

- [battery](gamecontroller/gccontroller/battery.md)
- [haptics](gamecontroller/gccontroller/haptics.md)
- [light](gamecontroller/gccontroller/light.md)

### Creating snapshots

- [withExtendedGamepad()](gamecontroller/gccontroller/withextendedgamepad().md)
- [withMicroGamepad()](gamecontroller/gccontroller/withmicrogamepad().md)
- [capture()](gamecontroller/gccontroller/capture().md)
- [isSnapshot](gamecontroller/gccontroller/issnapshot.md)

### Responding to a paused controller or controller event

- [controllerPausedHandler](gamecontroller/gccontroller/controllerpausedhandler.md)
- [GCGameControllerSceneDelegate](gamecontroller/gcgamecontrollerscenedelegate.md)
- [GCEventInteraction](gamecontroller/gceventinteraction.md)

### Identifying the activation context

- [GCGameControllerActivationContext](gamecontroller/gcgamecontrolleractivationcontext.md)

### Structures

- [GCController.DidBecomeCurrentMessage](gamecontroller/gccontroller/didbecomecurrentmessage.md)
- [GCController.DidConnectMessage](gamecontroller/gccontroller/didconnectmessage.md)
- [GCController.DidDisconnectMessage](gamecontroller/gccontroller/diddisconnectmessage.md)
- [GCController.DidStopBeingCurrentMessage](gamecontroller/gccontroller/didstopbeingcurrentmessage.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [GCDevice](gamecontroller/gcdevice.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Game controllers

- [Supporting Game Controllers](gamecontroller/supporting-game-controllers.md)
- [Letting players use their second-generation Siri Remote as a game controller](gamecontroller/letting-players-use-their-second-generation-siri-remote-as-a-game-controller.md)
- [Discovering and tracking spatial game controllers and styli](gamecontroller/discovering-and-tracking-spatial-game-controllers-and-styli.md)
- [GCDevice](gamecontroller/gcdevice.md)
- [GCRacingWheel](gamecontroller/gcracingwheel.md)
- [GCKeyboard](gamecontroller/gckeyboard.md)
- [GCMouse](gamecontroller/gcmouse.md)
- [GCStylus](gamecontroller/gcstylus.md)
