1

I'm using Safari Services kit to present a web view when an SCNode is clicked. However, when I go back from the safariVC to my VC with the sceneView, the sceneView is frozen even though I restart the session by re-running the session.

I read on this website that presenting another VC kills the scene view thread and I would just like confirmation. Basically I want to know whether it is possible to present another VC and be able to go back to the sceneView and "resume" the scenView

Note:

  • VC = ViewController

Code

How I present my safari web VC

func presentWebView(){
    if let url = URL(string: "https://www.amazon.com/"){
        let safariVC = SFSafariViewController(url: url)
        self.present(safariVC, animated: true, completion: nil)
    }
}

How I restart my session

if let worldSessionConfig = sessionConfig as? ARWorldTrackingSessionConfiguration {
    worldSessionConfig.planeDetection = .horizontal
    session.run(worldSessionConfig, options: [.resetTracking, .removeExistingAnchors])
}
Community
  • 1
  • 1
14wml
  • 4,048
  • 11
  • 49
  • 97

1 Answers1

2

Use sceneView.session.pause() when you present safariVC and then use sceneView.session.run to restart session when safariVC is dismissed.

Satish Mavani
  • 4,897
  • 2
  • 20
  • 30