A control element measuring movement along a particular axis.


class GCControllerAxisInput : GCControllerElement


An axis element is always an analog element.


Polling the Axis’ Value

var value: Float

The current value of the axis.

Receiving Notifications When the Axis’ Value Changes

var valueChangedHandler: GCControllerAxisValueChangedHandler?

A handler to be called when the axis changes value.


typealias GCControllerAxisValueChangedHandler

The signature for the block executed when an axis changes values.

Instance Methods


Inherits From

Conforms To

See Also

Input Elements

class GCControllerElement

An input associated with a physical control, such as a button or thumbstick.

class GCControllerButtonInput

A control element measuring a button press.

class GCControllerDirectionPad

A control element associated with a directional pad or a thumbstick.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software