Skip to content

Instantly share code, notes, and snippets.

@giln
Created March 4, 2019 14:34
Show Gist options
  • Save giln/73dae2b5fb99837d1dedf7ef0f68e3b9 to your computer and use it in GitHub Desktop.
Save giln/73dae2b5fb99837d1dedf7ef0f68e3b9 to your computer and use it in GitHub Desktop.
ARViewController #2
import ARKit
class ARViewController: UIViewController, ARSessionDelegate {
// MARK: - Variables
let sceneView = ARSCNView()
// MARK: - Lifecycle
override func loadView() {
super.loadView()
view = sceneView
// Create a session configuration
let configuration = ARWorldTrackingConfiguration()
// We want to receive the frames from the video
sceneView.session.delegate = self
// Run the session with the configuration
sceneView.session.run(configuration)
}
// MARK: - ARSessionDelegate
func session(_ session: ARSession, didUpdate frame: ARFrame) {
// This is where we will analyse our frame
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment