Contents

handleInvite(fromGameCenter:)

Sent to the delegate when the local player receives an invitation to join a new turn-based match.

Declaration

func handleInvite(fromGameCenter playersToInvite: [String])

Parameters

  • playersToInvite:

    An array of NSString objects containing the player identifiers for the players to initially invite to the game.

Discussion

When your delegate receives this message, your game should create a new GKMatchRequest object and assign the playersToInvite parameter to the match request’s playersToInvite property. Then, your game can either call the GKTurnBasedMatch class method find(for:withCompletionHandler:) to find a match programmatically or it can use the request to instantiate a new GKTurnBasedMatchmakerViewController object to show a user interface to the player.

See Also

Receiving Turn-based Events