Skip to content

Instantly share code, notes, and snippets.

@giln
Created March 4, 2019 14:41
Show Gist options
  • Save giln/3267875a8557fa923880e3834b374fdb to your computer and use it in GitHub Desktop.
Save giln/3267875a8557fa923880e3834b374fdb to your computer and use it in GitHub Desktop.
Preview
var previewView = UIImageView()
// 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)
view.addSubview(previewView)
previewView.translatesAutoresizingMaskIntoConstraints = false
previewView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
previewView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment