gpt4 book ai didi

ios - 如何在旧的 iOS 设备上使用 ARKit?

转载 作者:可可西里 更新时间:2023-11-01 05:07:29 28 4
gpt4 key购买 nike

在 iOS 11 测试版中,ARKit 应用程序即使在使用应该与旧设备兼容的 3DOF 时也会崩溃?

如果不支持 ARKit,我该如何防止应用程序崩溃?

最佳答案

支持的设备

从 iOS 11 开始,您 can't在旧设备上使用 ARKit:

Important

ARKit requires an iOS device with an A9 or later processor.

To make your app available only on devices supporting ARKit, use thearkit key in the UIRequiredDeviceCapabilities section of your app'sInfo.plist. If augmented reality is a secondary feature of your app,use the isSupported property to determine whether the current devicesupports the session configuration you want to use.

设备应配备 A9 或更高版本的处理器。您只能使用:

  • iPhone SE
  • iPhone 6S 及更新机型(7、8、X)
  • iPad (2017) 或更新机型,
  • iPad Pro(任何)。

防止崩溃

为防止应用程序崩溃,您可以使用 isSupported ARConfiguration 的属性。并且不要忘记检查当前的 iOS 版本。

import ARKit

func isARSupported() -> Bool {
guard #available(iOS 11.0, *) else {
return false
}
return ARConfiguration.isSupported
}

if isARSupported() {
// ARKit is supported. Do what you need.
} else {
// ARKit is not supported.
}

Before attempting to create an AR configuration, verify that theuser’s device supports the configuration you plan to use by checkingthe isSupported property of the corresponding configuration class. Ifthis property’s value is false, the current device does not supportthe requested configuration.

关于ios - 如何在旧的 iOS 设备上使用 ARKit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45061941/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com