Instance Method

match(_:didReceive:forRecipient:fromRemotePlayer:)

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

Declaration

optional func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer)

Parameters

match

The GKMatch object that received the data.

data

The bytes sent by the player.

recipient

The GKPlayer object identifying the player that received the data.

player

The GKPlayer object identifying 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

Receiving Data from Other Players