Contents

matchmakerViewController(_:didFind:)

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

Declaration

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

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