加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 18:07:51 所属栏目:百科 来源:网络整理
导读:对于iOS 11的测试版,即使使用与旧设备兼容的3DOF,ARKit应用程序也会崩溃? 如果不支持ARKit,我该如何防止应用程序崩溃? 解决方法 支持的设备 从iOS 11开始,can’t在旧设备上使用ARKit: Important ARKit requires an iOS device with an A9 or later proces
对于iOS 11的测试版,即使使用与旧设备兼容的3DOF,ARKit应用程序也会崩溃?

如果不支持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 the
arkit key in the UIRequiredDeviceCapabilities section of your app’s
Info.plist. If augmented reality is a secondary feature of your app,
use the isSupported property to determine whether the current device
supports the session configuration you want to use.

设备应具有A9或更高版本的处理器.您只能使用:

> iPhone SE,
> iPhone 6S及更新版(7,8,X),
> iPad(2017)或更新版本,
> iPad Pro(任何).

防止崩溃

要防止应用程序崩溃,您可以使用ARConfiguration的isSupported属性.别忘了检查当前的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 the user’s device supports the configuration you plan to use by checking the isSupported property of the corresponding configuration class. If this property’s value is false,the current device does not support the requested configuration.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读