Created
November 5, 2018 15:10
-
-
Save iannase/b7972e4f7bfd26c942b245f3839363a7 to your computer and use it in GitHub Desktop.
Basic ARKit ViewController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import ARKit | |
class ARViewController: UIViewController, ARSCNViewDelegate { | |
@IBOutlet weak var sceneView: ARSCNView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
sceneView.delegate = self | |
} | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
let configuration = ARWorldTrackingConfiguration() | |
sceneView.session.run(configuration) | |
} | |
override func viewWillDisappear(_ animated: Bool) { | |
super.viewWillDisappear(animated) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment