<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKSavedGame/loadData(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKSavedGame(im)loadDataWithCompletionHandler:"
  },
  "title" : "loadData(completionHandler:)"
}
-->

# loadData(completionHandler:)

Loads the game data from the file.

```
func loadData(completionHandler handler: (@Sendable (Data?, (any Error)?) -> Void)? = nil)
```

## Parameters

`handler`

The block that this method calls when it completes the request.

    The block receives the following parameters:

- *data*: The data object that you saved to the file using the [`saveGameData(_:withName:completionHandler:)`](/documentation/GameKit/GKLocalPlayer/saveGameData(_:withName:completionHandler:)) method
- *error*: Describes an error if it occurs, or `nil` if the operation completes.

## Discussion

---

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)