2

is there a way in Swift to check if the device has a LiDAR sensor? Unfortunately I've didn't find anything in the official Apple documentary nor with internet search.

My current workaround is to determine the device type like described in this post: How to determine the current iPhone/device model?

Thanks

TRS
  • 163
  • 2
  • 12

1 Answers1

2

Use this code:-

import ARKit

let supportLiDAR = ARWorldTrackingConfiguration.supportsSceneReconstruction(.mesh)
guard supportLiDAR else {
    print("LiDAR isn't supported here")
    return
}

Scene reconstruction requires a device with a LiDAR Scanner, such as the fourth-generation iPad Pro.

reference:- https://developer.apple.com/documentation/arkit/arworldtrackingconfiguration/3521377-supportsscenereconstruction

Datt Patel
  • 1,038
  • 1
  • 10
  • 9