Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge latest master into dev to sync versions #286

Merged
merged 8 commits into from
Apr 1, 2020
Original file line number Diff line number Diff line change
@@ -1,57 +1,55 @@
/**
This file shows basic Vision SDK configuration steps.
*/
// This file shows basic Vision SDK configuration steps.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave the current formatting of example headers. Didn't notice that in PR to master.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formally, it was an empty doc comment which is incorrect.

I propose to merge the current PR anyway to sync the state, but we can use multiline comment

/*
This file shows basic Vision SDK configuration steps.
*/

here and in the rest of places later (while we're merging examples/code snippets).

Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok to merge it like this and adjust with other example PRs.
As for the comment look, we have already chosen the style for such comments (all the example files follow it), do you suggest to change it?


import MapboxVision
import MapboxVisionAR
import MapboxVisionSafety

class GettingStartedViewController: UIViewController {

private var videoSource: CameraVideoSource!

private var visionManager: VisionManager!
private var visionARManager: VisionARManager!
private var visionSafetyManager: VisionSafetyManager!

override func viewDidLoad() {
super.viewDidLoad()

// create a video source obtaining buffers from camera module
videoSource = CameraVideoSource()

// create VisionManager with video source
visionManager = VisionManager.create(videoSource: videoSource)
// set up the `VisionSafetyManagerDelegate`
// set up the `VisionManagerDelegate`
visionManager.delegate = self

// create VisionARManager to use AR features
visionARManager = VisionARManager.create(visionManager: visionManager)
// set up the `VisionSafetyManagerDelegate`
// set up the `VisionARManagerDelegate`
visionARManager.delegate = self

// create VisionSafetyManager to use Safety features
visionSafetyManager = VisionSafetyManager.create(visionManager: visionManager)
// set up the `VisionSafetyManagerDelegate`
visionSafetyManager.delegate = self
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

// start delivering events
videoSource.start()
visionManager.start()
}

override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)

// stop delivering events
videoSource.stop()
visionManager.stop()
}

deinit {
// AR and Safety managers should be destroyed before the Vision manager
visionARManager.destroy()
Expand All @@ -73,4 +71,3 @@ extension GettingStartedViewController: VisionARManagerDelegate {
extension GettingStartedViewController: VisionSafetyManagerDelegate {
// implement required methods of the delegate
}