Mac Developer Library

Developer

GameKit Framework Reference GKTurnBasedEventHandler Class Reference

Options
Deployment Target:

On This Page
Language:

GKTurnBasedEventHandler

Inheritance


Conforms To


Import Statement


Swift

import GameKit

Objective-C

@import GameKit;

Availability


Available in OS X v10.8 and later.
Deprecated in OS X v10.10.

The GKTurnBasedEventHandler class is used to respond to important messages related to turn-based matches. To use it, call the sharedTurnBasedEventHandler class method to get the singleton instance and assign an object that implements the GKTurnBasedEventHandlerDelegate protocol to its delegate property. All methods are called on the main thread.

This framework has been deprecated in iOS 7. Use GKTurnBasedEventListener.

Subclassing Notes

This class may not be subclassed.

  • Returns the shared instance of the event handler.

    Declaration

    Swift

    class func sharedTurnBasedEventHandler() -> GKTurnBasedEventHandler!

    Objective-C

    + (GKTurnBasedEventHandler *)sharedTurnBasedEventHandler

    Return Value

    An event handler object.

    Discussion

    Your game never directly creates a GKTurnBasedEventHandler object. Instead, retrieve the shared instance using this class method.

    Import Statement

    Objective-C

    @import GameKit;

    Swift

    import GameKit

    Availability

    Available in OS X v10.8 and later.

    Deprecated in OS X v10.10.

  • delegate delegate (OS X v10.10) Property

    The delegate for the event handler.

    Declaration

    Swift

    unowned(unsafe) var delegate: NSObject!

    Objective-C

    @property(assign, atomic) NSObject < GKTurnBasedEventHandlerDelegate > *delegate

    Discussion

    If your game implements turn-based matches, it should set the delegate immediately after the local player is successfully authenticated. You want to set the delegate immediately because your game may have been launched specifically to handle a turn-based match event.

    Import Statement

    Objective-C

    @import GameKit;

    Swift

    import GameKit

    Availability

    Available in OS X v10.8 and later.

    Deprecated in OS X v10.10.