swift - 静态成员 'isSupported' 不能在类型 'ARConfiguration' 的实例上使用

标签 swift arkit

获取'静态成员'isSupported'不能用于类型'ARConfiguration'的实例'

import ARKit
    // Display Agumented button only if device supports it
    let session = ARSession()
    var sessionConfig: ARConfiguration = ARWorldTrackingConfiguration()
    if sessionConfig.isSupported {
        bottomBarView.leadingBarButtonItems = [ hButton, fButton, agumentedButton ] }
    else { bottomBarView.leadingBarButtonItems = [ hButton, fButton ] }

    bottomBarView.trailingBarButtonItems = [ aButton, bhButton, cButton ]
  }

我在这里做错了什么?

最佳答案

由于错误消息清楚地告诉您,您必须说

if ARWorldTrackingConfiguration.isSupported {

关于swift - 静态成员 'isSupported' 不能在类型 'ARConfiguration' 的实例上使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48772807/

相关文章:

ios - Unity - 初始放置后禁用 AR HitTest

swift - ARKit – 图像相似但颜色不同的图像识别

ios - 是否有可能有一个 SCNNode 是透明的,但它遮挡了它后面的任何对象?

ios - 带子节点的SceneKit Collada动画

ios - 在 Swift 中持续更新 UILabel

swift - 图像的圆角

swift - 使用 Swift 和 lldb 设置符号断点

swift - 如何使用 `JSON.Element` 将 `JSON` 转换为 "SwiftyJSON"?

objective-c - Swift 和 Xcode 6.1 的布局问题

iOS 创建对象最佳实践