ARDelegate

@objc
public protocol ARDelegate

The ARDelegate protocol provides a mechanism for your application to take action on events that occur in the ARViewController(Objc). You can make use of these calls by assigning an object to the ARViewController delegate property directly, or connect through Interface Builder.

  • Function will be executed when marker has been recognized.

    Declaration

    Swift

    @objc
    optional func recognizedMarker(withId markerId: Int, assetIds: [Int])

    Parameters

    markerId

    The id of recognized marker.

    assetIds

    The array of asset ids connected to this marker.

  • Function will be executed when timeout is reached and no one marker is recognized.

    Declaration

    Swift

    @objc
    optional func recognitionTimeoutReached()
  • Function will be executed on click of any asset.

    Declaration

    Swift

    @objc
    optional func assetClicked(with assetId: Int)

    Parameters

    assetId

    The id of clicked asset.

  • Function will be executed when ARView has changed state.

    Declaration

    Swift

    @objc
    optional func viewStateChanged(_ state: ARViewState)

    Parameters

    state

    The state of ARView.

  • Function will be executed when an error occurs.

    Declaration

    Swift

    @objc
    optional func didFail(withError error: BearError)

    Parameters

    error

    The error that occurred.