ios - 在 Swift 中检查 iOS 设备是否有 LiDAR
问题描述
Swift 中有没有办法检查设备是否有 LiDAR 传感器?不幸的是,我在 Apple 官方纪录片和互联网搜索中都没有找到任何内容。
我目前的解决方法是确定设备类型,如本文所述: 如何确定当前的 iPhone/设备型号?
谢谢
解决方案
使用此代码:-
import ARKit
let supportLiDAR = ARWorldTrackingConfiguration.supportsSceneReconstruction(.mesh)
guard supportLiDAR else {
print("LiDAR isn't supported here")
return
}
场景重建需要配备激光雷达扫描仪的设备,例如第四代 iPad Pro。
推荐阅读
- electron - 如何用窗口标题中的自定义图标替换电子js默认图标
- python - discord.ext.commands.errors.CommandInvokeError:命令引发异常:AttributeError:“NoneType”对象没有属性“提及”
- html - 使用jquery的导航栏的活动功能不起作用
- sql - 相关子查询 - 在内部查询中分组并重写为窗口函数
- python-3.x - 导入烧瓶应用程序上下文时出现 Python3 错误
- javascript - 组件异常找不到变量:ratingCompleted
- wordpress - 在 api v3 中更改 woocommerce 订单总数
- scala - 我可以在 Rainier 中使用学生 T 分布吗?
- laravel - 为什么 Nginx 不将协议更改为 WebSocket?
- c - (初学者)在 C 中找不到此代码的问题,它为浮点数返回奇怪的值(-nanloat)