Class

MCBrowserViewController

The MCBrowserViewController class presents nearby devices to the user and enables the user to invite nearby devices to a session. To use this class in iOS or tvOS, call methods from the underlying UIViewController class (prepareForSegue:sender: and performSegueWithIdentifier:sender: for storyboards or presentViewController:animated:completion: and dismissViewControllerAnimated:completion: for nib-based views) to present and dismiss the view controller. In macOS, use the comparable NSViewController methods presentViewControllerAsSheet: and dismissViewController: instead.

Declaration

iOS, Mac Catalyst, tvOS
@interface MCBrowserViewController : UIViewController
macOS
@interface MCBrowserViewController : NSViewController

Topics

Initializing a Browser View Controller

- initWithServiceType:session:

Initializes a browser view controller using the provided service type and session.

- initWithBrowser:session:

Initializes a browser view controller with the provided browser and session.

delegate

The delegate object that handles browser-view-controller-related events.

browser

The browser object that is used for discovering peers.

session

The multipeer session to which the invited peers are connected.

Getting and Setting the Maximum and Minimum Number of Peers

maximumNumberOfPeers

The maximum number of peers allowed in a session, including the local peer.

minimumNumberOfPeers

The minimum number of peers that need to be in a session, including the local peer.