Instance Method

addPlayers(to:)

Adds new players to an existing match instead of starting a new match.

Declaration

func addPlayers(to match: GKMatch)

Parameters

match

An existing match that you want to add players to.

Discussion

Your game calls this method prior to presenting the view controller to the player. Calling this method instructs the view controller to add new players to the provided match rather than creating a new match.

When called, this method sets the delegate on the match to nil and updates the view controller’s user interface to display the players already connected to the match.