代码之家  ›  专栏  ›  技术社区  ›  imjaydeep

如何检查iOS 11安装的设备是否支持ARKit?

  •  3
  • imjaydeep  · 技术社区  · 8 年前

    我目前正在进行 ARKit 阿基特 支持的设备。

    UIViewController s

    1) 阿基特 视图控制器 2) 非- 阿基特

    我必须根据设备支持设置一个视图控制器。

    阿基特

    if #available(iOS 11.0, *) {
                arProfileClosetController = THARClosetViewController(nibName: THARClosetViewController.className, bundle: nil)
            } else {
                arProfileClosetController = THNonARClosetViewController(nibName: THNonARClosetViewController.className, bundle: nil)
    }
    
    1 回复  |  直到 8 年前
        1
  •  5
  •   Mert Buran    8 年前

    您可以在运行时检查此属性: ARConfiguration.isSupported

    if (ARConfiguration.isSupported) {
        arProfileClosetController = THARClosetViewController(nibName: THARClosetViewController.className, bundle: nil)
    } else {
        arProfileClosetController = THNonARClosetViewController(nibName: THNonARClosetViewController.className, bundle: nil)
    }
    
    推荐文章