Protocol

GKMatchDelegate

The delegate is called when status updates and network data is received from players.

Overview

The GKMatchDelegate protocol is implemented by delegates of the GKMatch class.

Topics

Receiving Data from Other Players

func match(GKMatch, didReceive: Data, forRecipient: GKPlayer, fromRemotePlayer: GKPlayer)

Called when data is received by a player from another player.

Receiving State Notifications About Other Players

func match(GKMatch, player: GKPlayer, didChange: GKPlayerConnectionState)

Called when a player connects to or disconnects from the match.

enum GKPlayerConnectionState

The state of another player in the match.

Handling Errors

func match(GKMatch, didFailWithError: Error?)

Called when the match cannot connect to any other players.

Reinviting a Player

func match(GKMatch, shouldReinviteDisconnectedPlayer: GKPlayer)

Called when a player in a two-player match was disconnected.

Deprecated Methods and Properties

func match(GKMatch, player: String, didChange: GKPlayerConnectionState)

Called when a player connects to or disconnects from the match.

Deprecated
func match(GKMatch, didReceive: Data, fromPlayer: String)

Called when data is received from a player.

Deprecated
func match(GKMatch, shouldReinvitePlayer: String)

Called when a player in a two-player match was disconnected.

Deprecated

Relationships

Inherits From

See Also

Getting and Setting the Delegate

var delegate: GKMatchDelegate?

The delegate for the match.