How to know a device is available to use captureTextFromCamera API?

The new captureTextFromCamera API allow device to use OCR in UIResponder,but how can I know this device support OCR or not ?

eg: iPhoneX:NO, iPhone13:YES

Replies

captureTextFromCamera requires that the device has Neural Engine support.

You could test for this using MCLDevice ane()...
...which returns nil if no Apple Neural Engine exists.

 MCLDevice ane() ?? @robnotyou. I don't find this API

My bad (typo), of course I meant "MLCDevice" (from the Machine Learning framework).

ane()

  • Creates a device that uses the Apple Neural Engine, if one exists

Ok,thx

But I can't find any Machine Learning framework in iOS SDK... In Core ML I can't find any API called MLCDevice 😶😶