Contents

match(_:player:didChange:)

Handles when players connect or disconnect from a match.

Declaration

optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState)

Parameters

  • match:

    The match joined by the player.

  • player:

    The player whose state changed.

  • state:

    The state of the player in the match.

Mentioned in

Discussion

If the match’s expectedPlayerCount property is 0 when GameKit invokes this method, you can start the game. If two or more players join the match, you can begin data and voice communication.

See Also

Receiving State Notifications About Other Players