<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCController"
  },
  "title" : "GCController"
}
-->

# GCController

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

```
class GCController
```

## 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()`](/documentation/GameController/GCController/controllers()) method to get the currently connected controllers. If necessary, use the [`startWirelessControllerDiscovery(completionHandler:)`](/documentation/GameController/GCController/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`](/documentation/GameController/GCController/playerIndex) property and set it, if necessary. For single-player games, use the [`current`](/documentation/GameController/GCController/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`](/documentation/GameController/GCController/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`](/documentation/GameController/GCExtendedGamepad/leftThumbstick) property of the [`GCExtendedGamepad`](/documentation/GameController/GCExtendedGamepad) profile to get the thumbstick state. Use the [`valueChangedHandler`](/documentation/GameController/GCExtendedGamepad/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()`](/documentation/GameController/GCController/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

[`class func controllers() -> [GCController]`](/documentation/GameController/GCController/controllers())

Returns the connected controllers for the device.

[`class func startWirelessControllerDiscovery(completionHandler: (() -> Void)?)`](/documentation/GameController/GCController/startWirelessControllerDiscovery(completionHandler:))

Starts searching for nearby wireless controllers.

[`class func stopWirelessControllerDiscovery()`](/documentation/GameController/GCController/stopWirelessControllerDiscovery())

Stops searching for nearby wireless controllers.

  <doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidConnect>

  <doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidDisconnect>

[`extern NSString * const GCControllerDidConnectNotification;`](/documentation/GameController/GCControllerDidConnectNotification)

A notification that posts after a controller connects to the device.

[`extern NSString * const GCControllerDidDisconnectNotification;`](/documentation/GameController/GCControllerDidDisconnectNotification)

A notification that posts after a controller disconnects from the device.

### Handling multiple controllers

[`class var current: GCController?`](/documentation/GameController/GCController/current)

The most recently used game controller.

  <doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidBecomeCurrent>

  <doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidStopBeingCurrent>

[`extern NSString * const GCControllerDidBecomeCurrentNotification;`](/documentation/GameController/GCControllerDidBecomeCurrentNotification)

A notification that posts when a controller becomes the current controller.

[`extern NSString * const GCControllerDidStopBeingCurrentNotification;`](/documentation/GameController/GCControllerDidStopBeingCurrentNotification)

A notification that posts when a controller stops being the current controller.

### Inspecting a controller

[`var isAttachedToDevice: Bool`](/documentation/GameController/GCController/isAttachedToDevice)

A Boolean value that indicates whether the controller closely integrates with the device.

[`class func supportsHIDDevice(IOHIDDevice) -> Bool`](/documentation/GameController/GCController/supportsHIDDevice(_:))

Returns a Boolean value that indicates whether the framework supports the specified human interface device.

[`class var shouldMonitorBackgroundEvents: Bool`](/documentation/GameController/GCController/shouldMonitorBackgroundEvents)

A Boolean value that indicates whether the app needs to respond to controller events when it isn’t the frontmost app.

### Accessing controller input

[`var input: GCControllerLiveInput`](/documentation/GameController/GCController/input)

The input profile for the controller.

[`class GCControllerLiveInput`](/documentation/GameController/GCControllerLiveInput)

The input profile for a controller.

[`class GCControllerInputState`](/documentation/GameController/GCControllerInputState)

A class that represents an input state for gamepads and arcade sticks.

### Accessing controller profiles

[`var extendedGamepad: GCExtendedGamepad?`](/documentation/GameController/GCController/extendedGamepad)

The extended gamepad profile.

[`class GCPhysicalInputProfile`](/documentation/GameController/GCPhysicalInputProfile)

The base class for controller profiles that support physical buttons, thumbsticks, and directional pads.

[`class GCKeyboardInput`](/documentation/GameController/GCKeyboardInput)

A controller profile that uses the keyboard as the input device.

[`class GCMouseInput`](/documentation/GameController/GCMouseInput)

A controller profile that tracks input from a mouse.

[`class GCExtendedGamepad`](/documentation/GameController/GCExtendedGamepad)

A controller profile that supports the extended set of gamepad controls.

[`class GCDualShockGamepad`](/documentation/GameController/GCDualShockGamepad)

A controller profile that supports the DualShock 4 controller.

[`class GCXboxGamepad`](/documentation/GameController/GCXboxGamepad)

A controller profile that supports the Xbox controller.

[`class GCDualSenseGamepad`](/documentation/GameController/GCDualSenseGamepad)

A controller profile that supported the DualSense controller.

[`var microGamepad: GCMicroGamepad?`](/documentation/GameController/GCController/microGamepad)

The micro gamepad profile.

[`class GCMicroGamepad`](/documentation/GameController/GCMicroGamepad)

A controller profile that supports the Siri Remote.

[`class GCDirectionalGamepad`](/documentation/GameController/GCDirectionalGamepad)

A profile that supports only the directional pad, without motion or rotation.

[`var motion: GCMotion?`](/documentation/GameController/GCController/motion)

The motion input profile.

[`var physicalInputProfile: GCPhysicalInputProfile`](/documentation/GameController/GCController/physicalInputProfile)

The physical input profile for the controller.

[`var gamepad: GCGamepad?`](/documentation/GameController/GCController/gamepad)

The gamepad profile.

### Accessing controller elements

[`class GCControllerElement`](/documentation/GameController/GCControllerElement)

An input for a physical control, such as a button or thumbstick.

[`class GCControllerAxisInput`](/documentation/GameController/GCControllerAxisInput)

A control element that tracks movement along an axis.

[`class GCControllerButtonInput`](/documentation/GameController/GCControllerButtonInput)

A control element that represents a button touch or press.

[`class GCControllerTouchpad`](/documentation/GameController/GCControllerTouchpad)

A control element that represents a touch event on a touchpad.

[`class GCControllerDirectionPad`](/documentation/GameController/GCControllerDirectionPad)

A control element associated with a directional pad or a thumbstick.

[`class GCDeviceCursor`](/documentation/GameController/GCDeviceCursor)

A control element for the cursor used as a directional pad.

[`class GCDualSenseAdaptiveTrigger`](/documentation/GameController/GCDualSenseAdaptiveTrigger)

A class that encapsulates the features of a DualSense adaptive trigger.

### Identifying controllers and displaying a player index

[`var playerIndex: GCControllerPlayerIndex`](/documentation/GameController/GCController/playerIndex)

The player index for the controller.

[`enum GCControllerPlayerIndex`](/documentation/GameController/GCControllerPlayerIndex)

The possible values for controller player indices.

### Accessing battery, haptics, and light objects

[`var battery: GCDeviceBattery?`](/documentation/GameController/GCController/battery)

The controller’s battery information.

[`var haptics: GCDeviceHaptics?`](/documentation/GameController/GCController/haptics)

The controller’s haptics information.

[`var light: GCDeviceLight?`](/documentation/GameController/GCController/light)

The controller’s light settings.

### Creating snapshots

[`class func withExtendedGamepad() -> GCController`](/documentation/GameController/GCController/withExtendedGamepad())

Returns a snapshot of a newly created controller with an extended gamepad profile.

[`class func withMicroGamepad() -> GCController`](/documentation/GameController/GCController/withMicroGamepad())

Returns a snapshot of a newly created controller with a micro gamepad profile.

[`func capture() -> GCController`](/documentation/GameController/GCController/capture())

Returns a snapshot of the controller with its current element values.

[`var isSnapshot: Bool`](/documentation/GameController/GCController/isSnapshot)

A Boolean value that indicates whether the controller is a snapshot of a controller.

### Responding to a paused controller or controller event

[`var controllerPausedHandler: ((GCController) -> Void)?`](/documentation/GameController/GCController/controllerPausedHandler)

The block that the framework calls when the user presses the pause button on the controller.

[`protocol GCGameControllerSceneDelegate`](/documentation/GameController/GCGameControllerSceneDelegate)

[`class GCEventInteraction`](/documentation/GameController/GCEventInteraction)

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

### Identifying the activation context

[`class GCGameControllerActivationContext`](/documentation/GameController/GCGameControllerActivationContext)

### Structures

[`struct DidBecomeCurrentMessage`](/documentation/GameController/GCController/DidBecomeCurrentMessage)

A message that posts after a game controller becomes the most recently
used controller.

[`struct DidConnectMessage`](/documentation/GameController/GCController/DidConnectMessage)

A message that posts after a game controller accessory connects to the
device.

[`struct DidDisconnectMessage`](/documentation/GameController/GCController/DidDisconnectMessage)

A message that posts after a game controller accessory disconnects from
the device.

[`struct DidStopBeingCurrentMessage`](/documentation/GameController/GCController/DidStopBeingCurrentMessage)

A message that posts after a game controller stops being the most
recently used controller.

## Relationships

### Conforms To

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

[`GCDevice`](/documentation/GameController/GCDevice)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

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

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)