controllers()
Returns the connected controllers for the device.
Declaration
class func controllers() -> [GCController]Mentioned in
Return Value
The currently connected controllers.
Discussion
To track the connection status of controllers, observe the framework notifications. The framework posts the GCControllerDidConnect (Swift) and GCControllerDidBecomeCurrent (Swift) notifications when a controller connects to a device. For Objective-C, it posts the GCControllerDidConnectNotification and GCControllerDidBecomeCurrentNotification notifications. When a controller disconnects from a device, it posts the GCControllerDidDisconnect (Swift) and GCControllerDidStopBeingCurrent (Swift) notifications. For Objective-C, it posts the GCControllerDidDisconnectNotification and GCControllerDidStopBeingCurrentNotification notifications.