Function

NSDataFromGCGamepadSnapShotDataV100(_:)

Encapsulates the controller data from a gamepad structure into an NSData object.

Declaration

func NSDataFromGCGamepadSnapShotDataV100(_ snapshotData: UnsafeMutablePointer<GCGamepadSnapShotDataV100>?) -> Data?

Parameters

snapshotData

A pointer to memory that contains a set of gamepad control values.

Return Value

A new NSData object that contains the snapshot data, or nil if an error occurred.

Discussion

If the version and size is not set in the snapshot the data will automatically have a version of 0x100 and a size equal to sizeof(GCGamepadSnapShotDataV100).

See Also

Flattening a Snapshot to Memory

struct GCGamepadSnapShotDataV100

A structure that holds a snapshot of a gamepad controller’s input data.

Deprecated
func GCGamepadSnapShotDataV100FromNSData(UnsafeMutablePointer<GCGamepadSnapShotDataV100>?, Data?) -> Bool

Copies the recorded data from a gamepad snapshot into a readable structure.

Deprecated