Contents

player(_:receivedTurnEventFor:didBecomeActive:)

Handles turn-based match events, such as accepting invitations, passing turns, and saving match data.

Declaration

optional func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool)

Parameters

  • player:

    The player who receives this turn-based event.

  • match:

    The match related to this turn-based event.

  • didBecomeActive:

    True if the system launches the game to deliver the turn-based event; otherwise, False.

Mentioned in

Discussion

GameKit invokes this method when these turn-based events occur:

  • GameKit passes the turn to the player.

  • The player accepts an invitation from another participant.

  • The timeout for the player to take their turn is about to expire.

  • A participant saves match data to Game Center.

  • Another participant sends a reminder to the player.

  • The player opens an existing or completed match.

  • The player forfeits a match.

See Also

Handling Match-Related Events