Instance Method

send(_:toPlayers:with:)

Transmits data to a list of connected players.

Declaration

func send(_ data: Data, toPlayers playerIDs: [String], with mode: GKMatch.SendDataMode) throws

Parameters

data

The bytes to be sent.

playerIDs

An array of NSString objects containing the identifier strings for the list of players who should receive the data.

mode

The mechanism used to send the data.

error

If the data could not be queued, on return, this parameter holds an NSError object describing the error.

Return Value

true if the data was successfully queued for transmission; false if the match was unable to queue the data.

Discussion

The match queues the data and transmits it when the network becomes available.

See Also

Deprecated Methods and Properties

func chooseBestHostPlayer(completionHandler: (String?) -> Void)

Determines the best player in the game to act as the server for a client-server match.

Deprecated
var playerIDs: [String]

An array of NSString objects containing the player identifiers for remote players in the match.

Deprecated