<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCVirtualController/Configuration/elements",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCVirtualControllerConfiguration(py)elements"
  },
  "title" : "elements"
}
-->

# elements

The input elements of a virtual controller.

```
var elements: Set<String> { get set }
```

## Discussion

The possible values you can include in this array are the names of the following constants: [`GCInputButtonA`](/documentation/GameController/GCInputButtonA-8z15w), [`GCInputButtonB`](/documentation/GameController/GCInputButtonB-6z361), [`GCInputButtonX`](/documentation/GameController/GCInputButtonX-32i2z), [`GCInputButtonY`](/documentation/GameController/GCInputButtonY-9x9i9), [`GCInputDirectionPad`](/documentation/GameController/GCInputDirectionPad-115st), [`GCInputLeftThumbstick`](/documentation/GameController/GCInputLeftThumbstick-3hlff), [`GCInputRightThumbstick`](/documentation/GameController/GCInputRightThumbstick-8469p), [`GCInputLeftShoulder`](/documentation/GameController/GCInputLeftShoulder-9assr), [`GCInputRightShoulder`](/documentation/GameController/GCInputRightShoulder-5lcq1), [`GCInputLeftTrigger`](/documentation/GameController/GCInputLeftTrigger-80png), and [`GCInputRightTrigger`](/documentation/GameController/GCInputRightTrigger-96vtj).

> Note:
> If you include both `GCInputDirectionPad` and `GCInputLeftThumbstick` in the array, the virtual controller contains only the left thumb stick, not the input direction pad.

For example, configure a virtual controller with a left thumb stick, right thumb stick, A button, and B button.

```swift
virtualConfiguration.elements = [GCInputLeftThumbstick,GCInputRightThumbstick,GCInputButtonA,GCInputButtonB]
```

---

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)