VisionManager

public final class VisionManager : BaseVisionManager

The main object for registering for events from the SDK, starting and stopping their delivery. It also provides some useful functions for performance configuration and data conversion.

Lifecycle of VisionManager :

  1. create
  2. start
  3. startRecording (optional)
  4. stopRecording (optional)
  5. stop, then lifecycle may proceed with destroy or start
  6. destroy
  • Delegate for VisionManager. Delegate is held as a weak reference.

    Declaration

    Swift

    public weak var delegate: VisionManagerDelegate? { get set }
  • Fabric method for creating a VisionManager instance.

    It’s only allowed to have one living instance of VisionManager or VisionReplayManager. To create VisionManager with different configuration call destroy on existing instance or release all references to it.

    Declaration

    Swift

    public static func create(videoSource: VideoSource) -> VisionManager

    Parameters

    videoSource

    Video source which will be utilized by created instance of VisionManager.

    Return Value

    Instance of VisionManager configured with video source.

  • Start delivering events from VisionManager.

    Important

    Do NOT call this method more than once or after destroy is called.

    Declaration

    Swift

    public func start()
  • Stop delivering events from VisionManager.

    To resume call start again. Call this method after start and before destroy. This method also stops recording session if it was started.

    Important

    Do NOT call this method more than once or before start or after destroy is called.

    Declaration

    Swift

    public func stop()
  • Start recording a session.

    During the session full telemetry and video are recorded to specified path. You may use resulted folder to replay the recorded session with VisionReplayManager.

    Important

    Method serves debugging purposes. Do NOT call this method more than once or before start or after stop is called. Do NOT use session recording in production applications.

    Throws

    VisionManagerError.startRecordingBeforeStart if method is called when VisionManager hasn’t been started.

    Declaration

    Swift

    public func startRecording(to path: String) throws

    Parameters

    path

    Path to directory where you’d like session to be recorded.

  • Stop recording a session.

    Important

    Method serves debugging purposes. Do NOT use session recording in production applications. Do NOT call this method more than once or before startRecording or after stop is called.

    Declaration

    Swift

    public func stopRecording()
  • Set the camera height above the road surface.

    Declaration

    Swift

    public func set(cameraHeight: Float)

    Parameters

    cameraHeight

    Camera height in meters.

  • Clean up the state and resources of VisionManger.

    Important

    Do NOT call this method more than once.

    Declaration

    Swift

    public func destroy()