Class
Enables your game to receive and be informed about events that are sent over the local network.
wake
( _: GPGameEventListener )Prompts the passed GPGameEventListener parameter to start listening. Call this method inside the init
function of the implementing class.
listeningTo
: Set<MCPeerID>A collection of MCPeerID
objects that distinguishes GPGameEventBroadcaster, whom self are listening to, apart.
<aside>
Tip
Conform self to @Observable macro, to enable this attribute to update itself in a SwiftUI’s view, in case it mutates.
</aside>
portAsDelegate
() → MCSessionDelegateConverts self to a MCSessionDelegate
object, which then can be passed to an instance of GPGameEventBroadcaster, to enable self to recieve its broadcast.