iOS Developer Library

Developer

MultipeerConnectivity Framework Reference MCBrowserViewControllerDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

MCBrowserViewControllerDelegate

Inheritance


Not Applicable

Import Statement


Swift

import MultipeerConnectivity

Objective-C

@import MultipeerConnectivity;

Availability


Available in iOS 7.0 and later.

The MCBrowserViewControllerDelegate protocol defines the methods that your delegate object can implement to handle events related to the MCBrowserViewController class.

  • Called when the browser view controller is dismissed with peers connected in a session. (required)

    Declaration

    Swift

    func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController!)

    Objective-C

    - (void)browserViewControllerDidFinish:(MCBrowserViewController *)browserViewController

    Parameters

    browserViewController

    The view controller that was dismissed.

    Discussion

    This call is intended to inform your app that the user has connected with nearby peers in a session and that the browser view controller has been dismissed. Upon receiving this delegate method call, your app must call dismissViewControllerAnimated:completion: to dismiss the view controller. Your app can also begin sending data to any connected peers, and should resume any UI updates that it may have temporarily suspended while the view controller was onscreen.

    Import Statement

    Objective-C

    @import MultipeerConnectivity;

    Swift

    import MultipeerConnectivity

    Availability

    Available in iOS 7.0 and later.

  • Called when the user cancels the browser view controller. (required)

    Declaration

    Swift

    func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController!)

    Objective-C

    - (void)browserViewControllerWasCancelled:(MCBrowserViewController *)browserViewController

    Parameters

    browserViewController

    The browser view controller that was canceled.

    Discussion

    This call is intended to inform your app that the view controller has been dismissed because the user canceled the discovery process and is no longer interested in creating a communication session.

    When your app receives this delegate method call, your app must call dismissViewControllerAnimated:completion: to dismiss the view controller. Then, your app should handle the cancelation in whatever way is appropriate for your app, and then resume any UI updates that it may have temporarily suspended while the view controller was onscreen.

    Import Statement

    Objective-C

    @import MultipeerConnectivity;

    Swift

    import MultipeerConnectivity

    Availability

    Available in iOS 7.0 and later.