Instance Method

match(_:didReceive:fromPlayer:)

Called when data is received from a player.

Declaration

optional func match(_ match: GKMatch, didReceive data: Data, fromPlayer playerID: String)

Parameters

match

The match that received the data.

data

The bytes sent by the player.

player

The string identifier for the player that sent the data.

Discussion

Your game defines its own format for data packets it transmits and receives over the network.

See Also

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, shouldReinvitePlayer: String) -> Bool

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

Deprecated