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

# matchmakerViewController(_:didReceiveAcceptFromHostedPlayer:)

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

## Declaration

```swift
optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String)
```

## Parameters

- `viewController`: The view controller that accepted the invitation.
- `playerID`: The identifier of the accepting player.

## Discussion

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

## See Also

### Deprecated Methods

- [matchmakerViewController(_:didFindPlayers:)](gamekit/gkmatchmakerviewcontrollerdelegate/matchmakerviewcontroller(_:didfindplayers:).md)
