---
title: "find(for:withCompletionHandler:)"
framework: gamekit
role: symbol
role_heading: Type Method
path: "gamekit/gkturnbasedmatch/find(for:withcompletionhandler:)"
---

# find(for:withCompletionHandler:)

Creates a new match or finds an existing match that needs a player.

## Declaration

```swift
class func find(for request: GKMatchRequest, withCompletionHandler completionHandler: @escaping @Sendable (GKTurnBasedMatch?, (any Error)?) -> Void)
```

```swift
class func find(for request: GKMatchRequest) async throws -> GKTurnBasedMatch
```

## Parameters

- `request`: The configuration for the turn-based match.
- `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 create or find a turn-based match on behalf of the local player. The local player is always the current participant in the match object GameKit passes to the completion handler. Therefore, implement the completion handler to show the gameplay interface and let the local player take their turn. To be consistent with older servers and earlier versions of iOS, GameKit sets the minimum number of players specified by the GKMatchRequest object to be equal to the maximum number of players when looking for a match.

## See Also

### Creating a Match

- [acceptInvite(completionHandler:)](gamekit/gkturnbasedmatch/acceptinvite(completionhandler:).md)
- [declineInvite(completionHandler:)](gamekit/gkturnbasedmatch/declineinvite(completionhandler:).md)
- [rematch(completionHandler:)](gamekit/gkturnbasedmatch/rematch(completionhandler:).md)
