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


init(browser: MCNearbyServiceBrowser, session: MCSession)



An object that the browser view controller uses for browsing. This is usually an instance of MCNearbyServiceBrowser. However, if your app is using a custom discovery scheme, you can instead pass any custom subclass that calls the methods defined in the MCNearbyServiceBrowserDelegate protocol on its delegate when peers are found and lost.


The multipeer session into which the invited peers are connected.

Return Value

Returns an initialized object, or nil if an error occurred.


This method throws an exception if the browser or session parameters do not contain valid objects.

See Also

Initializing a Browser View Controller

init(serviceType: String, session: MCSession)

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

var delegate: MCBrowserViewControllerDelegate?

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

var browser: MCNearbyServiceBrowser?

The browser object that is used for discovering peers.

var session: MCSession

The multipeer session to which the invited peers are connected.