当我从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])
}