---
title: "matchmakerViewController(_:didFind:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkmatchmakerviewcontrollerdelegate/matchmakerviewcontroller(_:didfind:)"
---

# matchmakerViewController(_:didFind:)

Handles when the view controller finds players for a peer-to-peer match.

## Declaration

```swift
optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFind match: GKMatch)
```

## Parameters

- `viewController`: The view controller that finds players for the match.
- `match`: The match that the players join.

## Mentioned in

Finding multiple players for a game Assigning players to teams using rules Exchanging data between players in real-time games Finding players for custom server-based games Finding players using matchmaking rules Finding players with similar skill levels

## Discussion

Discussion When all the players accept their invitations to a match, GameKit invokes this method in the app instances for all players in the match, including the local player who initiates the match. This method needs to dismiss the view controller and start the game. Use the match object passed to this method to get the players and communicate between them during the game. Although this method appears optional in the protocol, if you set the view controller’s delegate for a peer-to-peer match, GameKit expects the delegate to implement this method. If the view controller’s isHosted property is true, GameKit instead invokes the matchmakerViewController(_:didFindHostedPlayers:) method.

## See Also

### Starting matches

- [matchmakerViewController(_:didFindHostedPlayers:)](gamekit/gkmatchmakerviewcontrollerdelegate/matchmakerviewcontroller(_:didfindhostedplayers:).md)
