<!--
{
  "availability" : [
    "iOS: 5.0.0 - 6.0.0",
    "iPadOS: 5.0.0 - 6.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 3.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKTurnBasedMatch/endTurn(withNextParticipant:match:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKTurnBasedMatch(im)endTurnWithNextParticipant:matchData:completionHandler:"
  },
  "title" : "endTurn(withNextParticipant:match:completionHandler:)"
}
-->

# endTurn(withNextParticipant:match:completionHandler:)

Updates the data stored on Game Center for the current match.

```
func endTurn(withNextParticipant nextParticipant: GKTurnBasedParticipant, match matchData: Data, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

## Parameters

`nextParticipant`

The next player in the match who needs to take an action. It must be one of the object’s stored in the match’s [`participants`](/documentation/GameKit/GKTurnBasedMatch/participants) property.

`matchData`

A serialized blob of data reflecting the game-specific state for the match. Do not pass `nil` as an argument.

`completionHandler`

A block to be called after the data is uploaded to Game Center.

    The block receives the following parameters:

- *error*: If an error occurred, this error object describes the error. If the operation was completed successfully, the value is `nil`.

## Discussion

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

---

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)