---
title: controllers()
framework: gamecontroller
role: symbol
role_heading: Type Method
path: gamecontroller/gccontroller/controllers()
---

# controllers()

Returns the connected controllers for the device.

## Declaration

```swift
class func controllers() -> [GCController]
```

## Mentioned in

Discovering game controllers Discovering and tracking spatial game controllers and styli

## Return Value

Return Value The currently connected controllers.

## Discussion

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.

## See Also

### Discovering controllers

- [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)
