send(_:with:completionHandler:)
Sends the indicated data to all connected players.
Declaration
func send(_ data: Data, with transport: GKTransportType, completionHandler: @escaping @Sendable ((any Error)?) -> Void)func send(_ data: Data, with transport: GKTransportType) async throwsParameters
- data:
A
Dataobject containing the information to be sent. - transport:
Determines how the data is sent.
- completionHandler:
A block that is called after the data has been sent.
- error
If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is nil. See
GameKit Constantsfor a list of error codes specific to GameKit.