从 MFMailComposeViewController 返回时 ARKit 场景视图被阻塞

ARKit Scene view blocked when go back from MFMailComposeViewController

当我从 MFMailComposeViewController 返回到 ARSCNView 时,我遇到了一个问题,场景被阻止,我仍然可以在被阻止的屏幕上与 3D 模型 (hitTesting) 交互.

你有什么解决办法吗?

YM

我的错。在我的 ARSCNView 控制器上,我没有重置函数 viewDidAppear 的配置。

求解:

override open func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    // Prevent the screen from being dimmed to avoid interuppting the AR experience.
    UIApplication.shared.isIdleTimerDisabled = true

    // Start the `ARSession`.
    resetTracking()
}


func resetTracking() {
    let configuration = ARWorldTrackingConfiguration()
    session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
}