ARSessionConfiguration 在 Xcode 9 GM 中未解决
ARSessionConfiguration unresolved in Xcode 9 GM
我使用 Xcode 9 的 Beta 版创建了一个 ARKit
项目,我可以在我的真实设备上 运行 毫无问题地完成它。
昨天,我升级到 Xcode 9 GM,没有接触任何东西, Xcode 显示多个错误,说它不知道 ARSessionConfiguration
即:
Use of undeclared type 'ARSessionConfiguration'
和:
Use of undeclared type 'ARWorldTrackingSessionConfiguration'
...对于此代码:
let session = ARSession()
var sessionConfig: ARSessionConfiguration = ARWorldTrackingSessionConfiguration()
我已经导入 ARKit
并在我的 ViewController 中使用 ARSCNViewDelegate
。
从 Xcode 的测试版打开项目时,它没有显示错误,我可以再次 运行 我的 phone.
上的应用程序
知道如何解决这个问题吗?
在 Xcode 9 GM 中,ARWorldTrackingSessionConfiguration 似乎已重命名为 ARWorldTrackingConfiguration:
https://developer.apple.com/documentation/arkit/arworldtrackingconfiguration
参考此更改:
https://github.com/markdaws/arkit-by-example/issues/7
ARSessionConfiguration 已重命名为 ARConfiguration:
https://developer.apple.com/documentation/arkit/arconfiguration
ARWorldTrackingSessionConfiguration
已被弃用并重命名为 ARWorldTrackingConfiguration
:See here
此外,ARSessionConfiguration
已被弃用并重命名为 ARConfiguration
,它现在是一个抽象基础 class。
当您不想进行世界跟踪时,请使用 AROrientationTrackingConfiguration,而不是使用通用的 ARConfiguration。因此:
let configuration = AROrientationTrackingConfiguration()
您还可以检查设备是否支持世界跟踪:
if ARWorldTrackingConfiguration.isSupported {
configuration = ARWorldTrackingConfiguration()
}
else {
configuration = AROrientationTrackingConfiguration()
}
我使用 Xcode 9 的 Beta 版创建了一个 ARKit
项目,我可以在我的真实设备上 运行 毫无问题地完成它。
昨天,我升级到 Xcode 9 GM,没有接触任何东西, Xcode 显示多个错误,说它不知道 ARSessionConfiguration
即:
Use of undeclared type 'ARSessionConfiguration'
和:
Use of undeclared type 'ARWorldTrackingSessionConfiguration'
...对于此代码:
let session = ARSession()
var sessionConfig: ARSessionConfiguration = ARWorldTrackingSessionConfiguration()
我已经导入 ARKit
并在我的 ViewController 中使用 ARSCNViewDelegate
。
从 Xcode 的测试版打开项目时,它没有显示错误,我可以再次 运行 我的 phone.
知道如何解决这个问题吗?
在 Xcode 9 GM 中,ARWorldTrackingSessionConfiguration 似乎已重命名为 ARWorldTrackingConfiguration:
https://developer.apple.com/documentation/arkit/arworldtrackingconfiguration
参考此更改:
https://github.com/markdaws/arkit-by-example/issues/7
ARSessionConfiguration 已重命名为 ARConfiguration:
https://developer.apple.com/documentation/arkit/arconfiguration
ARWorldTrackingSessionConfiguration
已被弃用并重命名为 ARWorldTrackingConfiguration
:See here
此外,ARSessionConfiguration
已被弃用并重命名为 ARConfiguration
,它现在是一个抽象基础 class。
当您不想进行世界跟踪时,请使用 AROrientationTrackingConfiguration,而不是使用通用的 ARConfiguration。因此:
let configuration = AROrientationTrackingConfiguration()
您还可以检查设备是否支持世界跟踪:
if ARWorldTrackingConfiguration.isSupported {
configuration = ARWorldTrackingConfiguration()
}
else {
configuration = AROrientationTrackingConfiguration()
}