iOS Developer Library

Developer

GameController Framework Reference GCExtendedGamepad Class Reference

Options
Deployment Target:

On This Page
Language:

GCExtendedGamepad

Inherits From


Conforms To


Import Statement


Swift

import GameController

Objective-C

@import GameController;

Availability


Available in iOS 7.0 and later

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(readonly, assign) GCController *controller

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • A block called when any element in the profile changes values.

    Declaration

    Swift

    var valueChangedHandler: GCExtendedGamepadValueChangedHandler!

    Objective-C

    @property(copy) GCExtendedGamepadValueChangedHandler valueChangedHandler

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • The left shoulder button element. (read-only)

    Declaration

    Swift

    var leftShoulder: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *leftShoulder

    Discussion

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

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • The right shoulder button element. (read-only)

    Declaration

    Swift

    var rightShoulder: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *rightShoulder

    Discussion

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

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    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(readonly) GCControllerDirectionPad *dpad

    Discussion

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

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • buttonA buttonA Property

    The bottom face button. (read-only)

    Declaration

    Swift

    var buttonA: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *buttonA

    Discussion

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

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • buttonB buttonB Property

    The right face button. (read-only)

    Declaration

    Swift

    var buttonB: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *buttonB

    Discussion

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

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • buttonX buttonX Property

    The left face button. (read-only)

    Declaration

    Swift

    var buttonX: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *buttonX

    Discussion

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

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • buttonY buttonY Property

    The top face button. (read-only)

    Declaration

    Swift

    var buttonY: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *buttonY

    Discussion

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

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • The left thumbstick element. (read-only)

    Declaration

    Swift

    var leftThumbstick: GCControllerDirectionPad! { get }

    Objective-C

    @property(readonly) GCControllerDirectionPad *leftThumbstick

    Discussion

    The thumbsticks in the extended gamepad profile are analog buttons.

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • The right thumbstick element. (read-only)

    Declaration

    Swift

    var rightThumbstick: GCControllerDirectionPad! { get }

    Objective-C

    @property(readonly) GCControllerDirectionPad *rightThumbstick

    Discussion

    The thumbsticks in the extended gamepad profile are analog buttons.

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • The left trigger element. (read-only)

    Declaration

    Swift

    var leftTrigger: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *leftTrigger

    Discussion

    The triggers in the extended gamepad profile are analog buttons.

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • The right trigger element. (read-only)

    Declaration

    Swift

    var rightTrigger: GCControllerButtonInput! { get }

    Objective-C

    @property(readonly) GCControllerButtonInput *rightTrigger

    Discussion

    The triggers in the extended gamepad profile are analog buttons.

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    Availability

    Available in iOS 7.0 and later

  • Saves a snapshot of all of the profile’s elements.

    Declaration

    Swift

    func saveSnapshot() -> GCExtendedGamepadSnapshot!

    Objective-C

    - (GCExtendedGamepadSnapshot *)saveSnapshot

    Return Value

    A snapshot object that contains the current controller state.

    Import Statement

    Objective-C

    @import GameController;

    Swift

    import GameController

    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