Contents

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