Instance Method

initWithBrowser:session:

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

Declaration

- (instancetype)initWithBrowser:(MCNearbyServiceBrowser *)browser session:(MCSession *)session;

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

- initWithServiceType:session:

Initializes a browser view controller using the provided service type 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.