简体   繁体   English

使用部署目标iOS 11强制使用ARKit版本2

[英]Force version 2 of ARKit with deployment target iOS 11

I have an app using ARKit 2 functionalities. 我有一个使用ARKit 2功能的应用程序。

  • With a deployment target set on iOS11 the camera is working on iOS11 devices but freeze on iOS12 在iOS11上设置了部署目标的情况下,相机可以在iOS11设备上运行,但在iOS12上冻结

  • With a deployment target set on iOS12 the camera is working on iOS12 devices, but the app can't run on iOS11 devices. 在iOS12上设置了部署目标的情况下,相机可以在iOS12设备上运行,但该应用程序无法在iOS11设备上运行。

Is there a way to target iOS11 while forcing the use of ARKit2, so I could still run the app on iOS11 devices while blocking the functionality for iOS11 users ? 是否可以在强制使用ARKit2的同时将iOS11定位为目标,所以我仍然可以在iOS11设备上运行该应用程序,同时阻止iOS11用户的功能?

Use Swift Availability Attributes. 使用Swift可用性属性。

if #available(iOS 12.0, *) {
  //activate your ARKit2 functionalities here
} else {
  //fallback for iOS 11 or lower
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM