GCGamepadSnapshot Class Reference

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

Overview

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.

To create a gamepad snapshot, call the saveSnapshot method on a GCGamepad object. The GCGamepadSnapshot class is a subclass of the GCGamepad class, so you can use the parent class’s properties to read the individual element values. To get the flattened data representation of the snapshot data, read the snapshotData property.

Tasks

Converting Between Snapshots and Data Objects

Properties

snapshotData

The flattened control input values for the snapshot.

@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.

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

Instance Methods

initWithSnapshotData:

Initializes a snapshot object with the flattened data representation obtained from another snapshot.

- (id)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.

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