Protocol: GKTurnBasedEventHandlerDelegate
Overview
The GKTurnBasedEventHandlerDelegate protocol is implemented by an object to receive notifications events for turn-based matches.Sent to the delegate when the local player receives an invitation to join a new turn-based match.Sent to the delegate when a match the local player is participating in has ended.Sent to the delegate when it is the local player’s turn to act in a turn-based match. (required)
Instance Method Summary (collapse)
-
- handleInviteFromGameCenter:
Sent to the delegate when the local player receives an invitation to join a new turn-based match.
-
- handleMatchEnded:
Sent to the delegate when a match the local player is participating in has ended.
-
- handleTurnEventForMatch:didBecomeActive:
Sent to the delegate when it is the local player’s turn to act in a turn-based match.
Instance Method Details
- (Object) handleInviteFromGameCenter(playersToInvite)
Sent to the delegate when the local player receives an invitation to join a new turn-based match. 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 findMatchForRequest: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.
- (Object) handleMatchEnded(match)
Sent to the delegate when a match the local player is participating in has ended. When your delegate receives this message, it should display the match’s final results to the player and allow the player the option of saving or removing the match data from Game Center.
- (Object) handleTurnEventForMatch(match, didBecomeActive:didBecomeActive)
Sent to the delegate when it is the local player’s turn to act in a turn-based match. (required) When your delegate receives this message, the player has accepted a push notification for a match already in progress. Your game should end whatever task it was performing and switch to the match information provided by the match object.