Contents

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:

  1. Create a GKMatchRequest object.

  2. Set the match request’s recipients property to playersToInvite.

  3. Create a GKTurnBasedMatchmakerViewController with the match request object.

  4. Present the turn-based matchmaker view controller.

See Also

Handling Match-Related Events