GCControllerElement Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/GameController.framework
Availability
Available in iOS 7.0 and later.
Companion guide
Declared in
GCControllerElement.h

Overview

A GCControllerElement object represents a measurable value on a controller profile. Typically, elements are mapped to physical controls on a controller. When a player manipulates those controls, the element object’s values change. The GCControllerElement class is never instantiated directly. Instead, subclasses that represent the different kinds of elements are instantiated. Table 1 lists the supported element types.

Table 1  Kinds of controller elements

Class

Description

GCControllerAxisInput

An element that measures movement along an axis.

GCControllerButtonInput

An element that measures a button press.

GCControllerDirectionPad

An element that measures movement across two different axes.

An element class usually represents an isolated element, such as a button, whose values can be read. However, an element can itself have child elements. For example, a direction pad is a two-dimensional control whose values can either be read as a pair of axis elements or four button elements. If an element is a child of another element, its collection property points to its parent element.

The analog property determines whether the element returns a range of values or discrete (digital) values.

Tasks

Inspecting Element Properties

Properties

analog

Returns a Boolean value that indicates whether the element provides analog data. (read-only)

@property(readonly, getter=isAnalog) BOOL analog
Discussion

If the value is YES, then the value properties defined by the element subclass can return a range (from minimum to maximum) of possible values. For example, this element might be a pressure-sensitive button or an axis of a thumb stick that allows for a range of physical movement. If the value is NO, then the element’s value properties only provides discrete values, typically 0 if the element is off, and 1 if the element is on.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCControllerElement.h

collection

Returns the element that this element is part of. (read-only)

@property(assign, readonly) GCControllerElement *collection
Discussion

If the element is part of another element, this property holds the parent element. Otherwise, it holds nil.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCControllerElement.h