Class
Enables your game to stream data & send events and resources over the local network.
init
( serves: MCPeerID )Initializes a broadcaster object which broadcasts on behalf of the passed parameter.
assistedBy
( _: GPGameEventListener ) → SelfEnables self to receive replies regarding its broadcast.
broadcast
( _: Data, to: [MCPeerID] ) throwsSends a Data
object over the network, destined to the specified receiving peers. The receiving party does not get to give their consent for the resoure to be transmitted.
stream
( _: InputStream, context: String, to: MCPeerID ) throws → OutputStreamInforms the receiving peer, that self would like to stream bytes over the network, and they should prepare to receive the information. Stream deliveries are controlled under consent the receiving peer.
send
( resourceAt: URL, to: MCPeerID, context: String, eventHandler: (((any Error)?) -> Void)? ) throws → Progress?Sends a resource located at the given URL to the receiving peer. The receiving party does not get to give their consent for the resoure to be transmitted.