Initializer

init(browser:session:)

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

Declaration

init(browser: MCNearbyServiceBrowser, session: MCSession)

Parameters

browser

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.

session

The multipeer session into which the invited peers are connected.

Return Value

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

Discussion

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.