Class

Enables your game to receive and be informed about events that are sent over the local network.


Initialization

func wake ( _: GPGameEventListener )

Prompts the passed GPGameEventListener parameter to start listening. Call this method inside the init function of the implementing class.

Listening to a Broadcast

var 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>

func portAsDelegate () → MCSessionDelegate

Converts self to a MCSessionDelegate object, which then can be passed to an instance of GPGameEventBroadcaster, to enable self to recieve its broadcast.

Relationships

Inherits From