player(_:didRequestMatchWithOtherPlayers:)
Handles when the player uses Game Center to start a match with other players.
Declaration
optional func player(_ player: GKPlayer, didRequestMatchWithOtherPlayers playersToInvite: [GKPlayer])Parameters
- player:
The player who receives this turn-based event.
- playersToInvite:
The players to invite in the view controller interface.
Mentioned in
Discussion
Implement this method to present a turn-based matchmaker interface configured with the players to invite:
Create a GKMatchRequest object.
Set the match request’s recipients property to
playersToInvite.Create a GKTurnBasedMatchmakerViewController with the match request object.
Present the turn-based matchmaker view controller.