I have setup a AR project. All seems to be working but I am not able to keep the AR session going when I present and dismiss a view controller over it.
So, I have a AR session setup like Xcode's sample project shows. Pretty simple. I then do this when the user taps on a button on the screen:
let myVC = MyVC()
present(myVC, animated: true) {
}
MyCV comes on screen and then I select an option, then the screen is dismissed:
dismiss(animated: true) { }
After MyVC is dismissed the ARSession looks frozen on in the view controller.
So, I thought maybe I have to tell it to run again so I added this line in the completion:
dismiss(animated: true) {
self.sceneView.session.run(ARWorldTrackingSessionConfiguration())
}
Nothing.
then I check on the delegate calls to make sure I wasn't getting any error:
func session(_ session: ARSession, didFailWithError error: Error) {
// Present an error message to the user
}
func sessionWasInterrupted(_ session: ARSession) {
// Inform the user that the session has been interrupted, for example, by presenting an overlay
}
func sessionInterruptionEnded(_ session: ARSession) {
// Reset tracking and/or remove existing anchors if consistent tracking is required
}
None of those is ever called during that process.
Why does the AR session appear frozen when precasting and dismissing a simple ViewController over it?