Contents

subscript(_:)

Returns the element that the key specifies.

Declaration

subscript(key: String) -> GCControllerElement? { get }

Parameters

  • key:

    A key that identifies an element.

Return Value

The element that matches the key.

Discussion

You can access elements of a profile using a subscript notation. For example, get the button with the X label from an instance of GCMicroGamepad using microGamepad[”Button X”].

See Also

Accessing elements by name or key