---
title: "save(_:completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkgamesession/save(_:completionhandler:)"
---

# save(_:completionHandler:)

Saves the current game session data.

## Declaration

```swift
func save(_ data: Data, completionHandler: @escaping (Data?, (any Error)?) -> Void)
```

## Parameters

- `data`: A Data object containing the information to be saved.
- `completionHandler`: A block that is called after the data has been saved.

## Discussion

Discussion The maximum amount of data to be saved is 512K. The lastModifiedDate and lastModifiedPlayer properties are updated upon completion. When a save conflict appears, the data is not saved to the server. The data property in the completion handler contains the information currently saved to the server. It is up to the developer to decide how to handle save conflicts.

## See Also

### Saving and Loading Data

- [loadData(completionHandler:)](gamekit/gkgamesession/loaddata(completionhandler:).md)
