---
title: "acceptInvite(completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkturnbasedmatch/acceptinvite(completionhandler:)"
---

# acceptInvite(completionHandler:)

Accepts an invitation for the local player to join a turn-based match.

## Declaration

```swift
func acceptInvite(completionHandler: (@Sendable (GKTurnBasedMatch?, (any Error)?) -> Void)? = nil)
```

```swift
func acceptInvite() async throws -> GKTurnBasedMatch
```

## Parameters

- `completionHandler`: The block that GameKit calls when it completes the request. The block receives the following parameters:

## Mentioned in

Starting turn-based matches and passing turns between players

## Discussion

Discussion When you provide a custom interface for managing matches, use this method to programmatically accept an invitation on behalf of the local player.

## See Also

### Creating a Match

- [find(for:withCompletionHandler:)](gamekit/gkturnbasedmatch/find(for:withcompletionhandler:).md)
- [declineInvite(completionHandler:)](gamekit/gkturnbasedmatch/declineinvite(completionhandler:).md)
- [rematch(completionHandler:)](gamekit/gkturnbasedmatch/rematch(completionhandler:).md)
