GKTurnBasedMatchmakerViewController Class Reference

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

Overview

The GKTurnBasedMatchmakerViewController class displays a user interface that allows players to manage the turn-based matches that they are participating in.

To show a turn-based matching user interface, first allocate and initialize a GKMatchRequest object that describes the desired match. Then, use the match request to initialize a new GKTurnBasedMatchmakerViewController object. Set the view controller’s delegate, present the view controller, and wait for the delegate to be called. The view controller’s delegate is notified when the matchmaking process is completed or canceled. Once the delegate is called, dismiss the view controller.

On iOS, you present and dismiss the view controller from another view controller in your game, using the methods provided by the UIViewController class. On OS X, you use the GKDialogController class to present and dismiss the view controller.

Tasks

Displaying a UI For Turn-Based Matches

Properties

showExistingMatches

A Boolean value that determines whether the view controller shows existing matches.

@property(nonatomic, readwrite, assign) BOOL showExistingMatches
Discussion

If the value of this property is YES, the view controller shows matches that are already in progress. If the value of this property is NO, the view controller only offers the ability to create new matches. The default value is YES.

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

turnBasedMatchmakerDelegate

The view controller’s delegate.

@property(nonatomic, readwrite, assign) id<GKTurnBasedMatchmakerViewControllerDelegate> turnBasedMatchmakerDelegate
Discussion

Your game must implement the delegate protocol on an object and assign that object to this property before presenting the view controller.

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

Instance Methods

initWithMatchRequest:

Initializes a new matchmaker view controller.

- (id)initWithMatchRequest:(GKMatchRequest *)request
Parameters
request

A match request with parameters for the match.

Return Value

An initialized matchmaker view controller. If an error occurred, this method returns NIL.

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