我目前正在开发基于 ARKit
的应用程序。我需要检查 ARKit
支持的设备。
我有两个 UIViewController
1)ARKit
View Controller
2) 非ARKit
View Controller 。
我必须根据设备支持设置一个 View Controller 之一。
目前我正在检查以下代码。但这不适用于某些不支持 ARKit
但装有 iOS 11 的设备。
if #available(iOS 11.0, *) {
arProfileClosetController = THARClosetViewController(nibName: THARClosetViewController.className, bundle: nil)
} else {
arProfileClosetController = THNonARClosetViewController(nibName: THNonARClosetViewController.className, bundle: nil)
}
最佳答案
您可以在运行时检查此属性:ARConfiguration.isSupported
if (ARConfiguration.isSupported) {
arProfileClosetController = THARClosetViewController(nibName: THARClosetViewController.className, bundle: nil)
} else {
arProfileClosetController = THNonARClosetViewController(nibName: THNonARClosetViewController.className, bundle: nil)
}
关于ios - 如何检查 iOS 11 安装的设备是否支持 ARKit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46129520/