Contents

browserViewController(_:shouldPresentNearbyPeer:withDiscoveryInfo:)

Called when a new peer is discovered to decide whether to show it in the user interface.

Declaration

optional func browserViewController(_ browserViewController: MCBrowserViewController, shouldPresentNearbyPeer peerID: MCPeerID, withDiscoveryInfo info: [String : String]?) -> Bool

Parameters

  • browserViewController:

    The browser view controller object that discovered the new peer.

  • peerID:

    The unique ID of the nearby peer.

  • 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.

Return Value

This delegate method should return true if the newly discovered peer should be shown in the user interface, or false otherwise.

Discussion

If this method is not provided, all peers are shown.