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

# matchmakerViewController(_:didFindPlayers:)

Called when a hosted match is found.

```
optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didFindPlayers playerIDs: [String])
```

## Parameters

`viewController`

The view controller that performed the matchmaking.

`playerIDs`

An array of `NSString` objects containing player identifier for the matched players.

## Discussion

This method is called when the view controller’s `hosted` property is <doc://com.apple.documentation/documentation/Swift/true>. Although optional in the protocol, if your game attaches a delegate to the view controller for a hosted match, the view controller expects your game to provide an implementation of this method.

The view controller returns the list of players to your game by calling this method. Your game is responsible for connecting these players to your own server and then using that server to relay messages between the players.

## See Also

[`matchmakerViewController(_:didFind:)`](/documentation/GameKit/GKMatchmakerViewControllerDelegate/matchmakerViewController(_:didFind:))

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



---

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)