CamoControllerDelegate

public protocol CamoControllerDelegate : AnyObject

A delegate that you must implement to use Camo in your app.

  • This method will be called on your delegate when the Camo controller state changes. You can use this to any cached state or UI.

    Declaration

    Swift

    func camoController(_ controller: CamoController, stateDidChangeTo state: CamoControllerState)

    Parameters

    controller

    The Camo controller sending this event.

    state

    The Camo controller state (see CamoController.state).

  • This method will be called on your delegate when there is a potential incoming connection.

    You should respond immediately to avoid unexpected issues. This method is not intended for long-running tasks, such as asking for user permission.

    You may use this if your app isn’t ready to accept connections yet, such as if you are presenting a tutorial or onboarding.

    Note

    This method is only called once for a detected device. If the user switches to a different device in Camo Studio and then back, it will not be called again, unlike camoController(_:,stateDidChangeTo:), which will be updated when the user changes devices.

    Declaration

    Swift

    func camoControllerShouldAcceptIncomingConnection(_ controller: CamoController) -> Bool

    Parameters

    controller

    The Camo controller responding to the connection.

    Return Value

    Whether or not your app has decided to accept the connection.