browser(_:foundPeer:withDiscoveryInfo:)
Called when a nearby peer is found.
Declaration
func browser(_ browser: MCNearbyServiceBrowser, foundPeer peerID: MCPeerID, withDiscoveryInfo info: [String : String]?)Parameters
- browser:
The browser object that found the nearby peer.
- peerID:
The unique ID of the peer that was found.
- info:
The info dictionary advertised by the discovered peer. For more information on the contents of this dictionary, see the documentation for Init(peer:discoveryinfo:servicetype:) in Mcnearbyserviceadvertiser.
Discussion
The peer ID provided to this delegate method can be used to invite the nearby peer to join a session.