iOS Developer Library — Prerelease

Developer

Game Controller Framework Reference GCExtendedGamepad Class Reference

Options
Deployment Target:

On This Page
Language:

GCExtendedGamepad

A GCExtendedGamepad object implements a logical profile for a set of gamepad controls. A profile maps the hardware controls of a particular controller to a set of elements usable by your game.

The controls associated with the extended gamepad profile include the following:

  • Two shoulder buttons.

  • Two triggers.

  • Four face buttons arranged in a diamond pattern.

  • One directional pad.

  • Two thumbsticks.

image: ../Art/featuresHIDGameControllerExtendedNonFormFittingSample.pdf
  • The controller this profile is associated with. (read-only)

    Declaration

    Swift

    weak var controller: GCController? { get }

    Objective-C

    @property(nonatomic, readonly, assign) GCController * _Nonnull controller

    Availability

    Available in iOS 7.0 and later.

  • dpad dpad Property

    The d-pad element. (read-only)

    Declaration

    Swift

    var dpad: GCControllerDirectionPad { get }

    Objective-C

    @property(nonatomic, readonly) GCControllerDirectionPad * _Nonnull dpad

    Discussion

    The directional pad in the extended gamepad profile is an analog control.

    Availability

    Available in iOS 7.0 and later.

  • The bottom face button. (read-only)

    Declaration

    Swift

    var buttonA: GCControllerButtonInput { get }

    Objective-C

    @property(nonatomic, readonly) GCControllerButtonInput * _Nonnull buttonA

    Discussion

    The face buttons in the extended gamepad profile are analog buttons.

    Availability

    Available in iOS 7.0 and later.

  • The right face button. (read-only)

    Declaration

    Swift

    var buttonB: GCControllerButtonInput { get }

    Objective-C

    @property(nonatomic, readonly) GCControllerButtonInput * _Nonnull buttonB

    Discussion

    The face buttons in the extended gamepad profile are analog buttons.

    Availability

    Available in iOS 7.0 and later.

  • The left face button. (read-only)

    Declaration

    Swift

    var buttonX: GCControllerButtonInput { get }

    Objective-C

    @property(nonatomic, readonly) GCControllerButtonInput * _Nonnull buttonX

    Discussion

    The face buttons in the extended gamepad profile are analog buttons.

    Availability

    Available in iOS 7.0 and later.

  • The top face button. (read-only)

    Declaration

    Swift

    var buttonY: GCControllerButtonInput { get }

    Objective-C

    @property(nonatomic, readonly) GCControllerButtonInput * _Nonnull buttonY

    Discussion

    The face buttons in the extended gamepad profile are analog buttons.

    Availability

    Available in iOS 7.0 and later.

Data Types

  • Signature for the block executed if any element in the extended gamepad profile changes value.

    Declaration

    Swift

    typealias GCExtendedGamepadValueChangedHandler = (GCExtendedGamepad, GCControllerElement) -> Void

    Objective-C

    typedef void (^GCExtendedGamepadValueChangedHandler)(GCExtendedGamepad *gamepad, GCControllerElement *element)

    Discussion

    The block parameters are defined as follows:

    gamepad

    The profile whose value changed.

    element

    The element whose value changed.

    If multiple elements change values at the same time, the block is called once for each element that changed. The block is called only for the elements directly attached to the profile object; if a child element of one of those elements changes values, the block is called for the parent.

    This block type is used by the valueChangedHandler property.

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later.