GKTurnBasedMatchmakerViewControllerDelegate Protocol Reference

Framework
/System/Library/Frameworks/GameKit.framework
Availability
Available in OS X v10.8 and later.
Companion guide
Declared in
GKTurnBasedMatchmakerViewController.h

Overview

Your game implements the GKTurnBasedMatchmakerViewControllerDelegate protocol on an object to respond to events generated by a GKTurnBasedMatchmakerViewController object.

Tasks

Events

Instance Methods

turnBasedMatchmakerViewController:didFailWithError:

Called when an error occurs. (required)

- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController *)viewController didFailWithError:(NSError *)error
Parameters
viewController

The view controller that received an error.

error

An error object that describes the error.

Discussion

Your game should dismiss the view controller.

Availability
  • Available in OS X v10.8 and later.
Declared In
GKTurnBasedMatchmakerViewController.h

turnBasedMatchmakerViewController:didFindMatch:

Called when the player selected a match to view. (required)

- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController *)viewController didFindMatch:(GKTurnBasedMatch *)match
Parameters
viewController

The view controller that found a match.

match

The match that the player selected.

Discussion

Your game should dismiss the view controller and use the match object to show the current state of the match to the player.

Availability
  • Available in OS X v10.8 and later.
Declared In
GKTurnBasedMatchmakerViewController.h

turnBasedMatchmakerViewController:playerQuitForMatch:

Called when a player chooses to quit the match. (required)

- (void)turnBasedMatchmakerViewController:(GKTurnBasedMatchmakerViewController *)viewController playerQuitForMatch:(GKTurnBasedMatch *)match
Parameters
viewController

The view controller that the player interacted with.

match

The match the player has chosen to quit.

Discussion

When this method is called, the player is the current participant in the match, but that player has chosen to resign the match instead of taking a turn. Your game should dismiss the view controller, set an outcome for the player, and then call the match’s participantQuitInTurnWithOutcome:nextParticipant:matchData:completionHandler: method.

Availability
  • Available in OS X v10.8 and later.
Declared In
GKTurnBasedMatchmakerViewController.h

turnBasedMatchmakerViewControllerWasCancelled:

Called when the player cancels matchmaking. (required)

- (void)turnBasedMatchmakerViewControllerWasCancelled:(GKTurnBasedMatchmakerViewController *)viewController
Parameters
viewController

The view controller that the player canceled.

Discussion

Your game should dismiss the view controller.

Availability
  • Available in OS X v10.8 and later.
Declared In
GKTurnBasedMatchmakerViewController.h