<!--
{
  "availability" : [
    "iOS: 7.0.0 - 13.0.0",
    "iPadOS: 7.0.0 - 13.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.9.0 - 10.15.0",
    "tvOS: 9.0.0 - 13.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/NSDataFromGCGamepadSnapShotDataV100(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:@F@NSDataFromGCGamepadSnapShotDataV100"
  },
  "title" : "NSDataFromGCGamepadSnapShotDataV100(_:)"
}
-->

# NSDataFromGCGamepadSnapShotDataV100(_:)

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

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

## Parameters

`snapshotData`

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

## Return Value

A new <doc://com.apple.documentation/documentation/Foundation/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)`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)