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


Discovering Controllers

class func stop​Wireless​Controller​Discovery()

Stops browsing for nearby controllers.

class func controllers()

The controllers connected to the device.

Determining Which Profiles Are Supported by a Controller

var gamepad:​ GCGamepad?

The gamepad profile.

var motion:​ GCMotion?

The motion input profile.

Responding When a Controller Is Paused

var controller​Paused​Handler:​ ((GCController) -> Void)?

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

Inspecting a Controller

var is​Attached​To​Device:​ Bool

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

var vendor​Name:​ String?

The name of the vendor that manufactured the controller.

Assigning a Player Index

var player​Index:​ GCController​Player​Index

The player index assigned to the controller.

Determining Which Dispatch Queue Notifications are Dispatched On

var handler​Queue:​ Dispatch​Queue

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



Predefined values for controller indices.


static let GCController​Did​Connect:​ NSNotification.Name

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

static let GCController​Did​Disconnect:​ NSNotification.Name

Posted immediately after a controller is disconnected from the device.


Inherits From