---
title: "match(for:completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkmatchmaker/match(for:completionhandler:)"
---

# match(for:completionHandler:)

Creates a match from an invitation that the local player accepts.

## Declaration

```swift
func match(for invite: GKInvite, completionHandler: (@Sendable (GKMatch?, (any Error)?) -> Void)? = nil)
```

```swift
func match(for invite: GKInvite) async throws -> GKMatch
```

## Parameters

- `invite`: The invitation that the local player accepts.
- `completionHandler`: The block that GameKit calls when it completes the request. This block receives the following parameters:

## Discussion

Discussion Use this method when you implement your own interface to inform you when the local player joins a match.
