Class

GCController

A representation of a physical game controller, connected to the device either physically or through a wireless connection.

Declaration

class GCController : NSObject

Topics

Discovering Controllers

class func stopWirelessControllerDiscovery()

Stops browsing for nearby controllers.

class func controllers() -> [GCController]

The controllers connected to the device.

Determining Which Profiles Are Supported by a Controller

var gamepad: GCGamepad?

The gamepad profile.

Deprecated
var extendedGamepad: GCExtendedGamepad?

The extended gamepad profile.

var microGamepad: GCMicroGamepad?

The micro gamepad profile.

var motion: GCMotion?

The motion input profile.

Responding When a Controller Is Paused

var controllerPausedHandler: ((GCController) -> Void)?

A block called when the controller’s pause button is pressed.

Deprecated

Inspecting a Controller

var isAttachedToDevice: Bool

A Boolean property that indicates whether the controller is closely integrated with the device.

var vendorName: String?

The name of the vendor that manufactured the controller.

Assigning a Player Index

var playerIndex: GCControllerPlayerIndex

The player index assigned to the controller.

Determining Which Dispatch Queue Notifications are Dispatched On

var handlerQueue: DispatchQueue

The dispatch queue to be used when the values of a game controller’s input values change.

Constants

enum GCControllerPlayerIndex

Predefined values for controller indices.

Notifications

static let GCControllerDidConnect: NSNotification.Name

Posted immediately after a new controller is connected to the device.

static let GCControllerDidDisconnect: NSNotification.Name

Posted immediately after a controller is disconnected from the device.

Instance Methods

Relationships

Inherits From

Conforms To

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software