<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatchmakerViewControllerDelegate/matchmakerViewController(_:hostedPlayerDidAccept:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKMatchmakerViewControllerDelegate(im)matchmakerViewController:hostedPlayerDidAccept:"
  },
  "title" : "matchmakerViewController(_:hostedPlayerDidAccept:)"
}
-->

# matchmakerViewController(_:hostedPlayerDidAccept:)

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

```
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.

## 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:)`](/documentation/GameKit/GKMatchmakerViewController/setHostedPlayer(_:didConnect:)) method to update the player’s connection status.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)