不允许使用 ARView 会话变量?

ARView Session Variable Not Allowed?

我觉得问这个问题有点傻。但我真的想不通。我一定错过了 import Swift 约定。

ARView document中提到ARView符合ARSessionProviding协议,有“session”变量。但是,当我使用 XCode 时,它一直显示错误:

Value of type 'ARView' has no member 'session'

xcode 项目(xcode-beta)设置为“iOS 13”,模拟器设置为“iPhone SE(13.5)”。

source code 来自 Apple(它似乎已经严重过时了)。错误来自“arView.session”

@IBOutlet var arView: ARView!
.....
arView.session.run(configuration)

确保您有 import RealityKit。另外,请确保您针对的是实际设备而不是 iOS 模拟器