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

# matchmakerViewController(_:hostedPlayerDidAccept:)

Handles when a player in a hosted match accepts the invitation.

## Declaration

```swift
optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, hostedPlayerDidAccept player: GKPlayer)
```

## Parameters

- `viewController`: The view controller that performs the matchmaking.
- `player`: The player that accepts the invitation to join the match.

## Mentioned in

Finding players for custom server-based games

## Discussion

Discussion After a player accepts an invitation, connect the player to your server. Once the connection is established, your game needs to call the view controller’s setHostedPlayer(_:didConnect:) method to update the player’s connection status.
