match(_:didReceive:fromPlayer:)
Handles when a player receives data in a match.
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.
- playerID:
The string identifier for the player that sent the data.
Discussion
You define your own format for data packets that you transmit and receive over the network.