Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created May 21, 2018 18:51
Show Gist options
  • Save azamsharp/9e4b604a0c6434a89973867c81f125f0 to your computer and use it in GitHub Desktop.
Save azamsharp/9e4b604a0c6434a89973867c81f125f0 to your computer and use it in GitHub Desktop.
@IBOutlet var sceneView: ARSCNView!
private var gSession :GARSession!
private var arAnchor :ARAnchor!
private var garAnchor :GARAnchor!
private var rootRef :DatabaseReference!
override func viewDidLoad() {
super.viewDidLoad()
self.rootRef = Database.database().reference()
self.sceneView.autoenablesDefaultLighting = true
// enable the arcore session
self.gSession = try! GARSession(apiKey: "PutYourOwnAPIKeyHere", bundleIdentifier: nil)
// Set the view's delegate
sceneView.delegate = self
self.gSession.delegate = self
self.gSession.delegateQueue = DispatchQueue.main
sceneView.session.delegate = self
// Create a new scene
let scene = SCNScene()
// Set the scene to the view
sceneView.scene = scene
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment