iOS Developer Library

Developer

GameController Framework Reference GCGamepadSnapshot Class Reference

Options
Deployment Target:

On This Page
Language:

GCGamepadSnapshot

A GCGamepadSnapshot object records all of the values from a gamepad profile at a particular moment in time. The snapshot is stored in a device independent format. You use snapshots when you need to record control information and use it later. More...

Inheritance


Conforms To


Import Statement


import GameController @import GameController;

Availability


Available in iOS 7.0 and later.
  • Initializes a snapshot object with the flattened data representation obtained from another snapshot.

    Declaration

    Swift

    init!(snapshotData data: NSData!)

    Objective-C

    - (instancetype)initWithSnapshotData:(NSData *)data

    Parameters

    data

    A data object that contains snapshot data.

    Return Value

    A new snapshot object.

    Discussion

    The data format for a snapshot is private. Your snapshot object should only be created from flattened data previously obtained from a snapshot.

    Import Statement

    import GameController

    Availability

    Available in iOS 7.0 and later.

  • Initializes a snapshot object associated with a specific controller using a flattened data representation obtained from another snapshot.

    Declaration

    Swift

    init!(controller controller: GCController!, snapshotData data: NSData!)

    Objective-C

    - (instancetype)initWithController:(GCController *)controller snapshotData:(NSData *)data

    Parameters

    controller

    The controller to associate the snapshot with.

    data

    A data object that contains snapshot data.

    Return Value

    A new snapshot object.

    Discussion

    The data format for a snapshot is private. Your snapshot object should only be created from flattened data previously obtained from a snapshot.

    Import Statement

    import GameController

    Availability

    Available in iOS 7.0 and later.

  • The flattened control input values for the snapshot.

    Declaration

    Swift

    @NSCopying var snapshotData: NSData!

    Objective-C

    @property(copy) NSData *snapshotData

    Discussion

    You can assign another NSData object containing snapshot data to this property. The elements of the snapshot are updated to the values stored in the flattened data. This triggers any value handlers attached to those elements.

    Import Statement

    import GameController

    Availability

    Available in iOS 7.0 and later.