luckysmg
luckysmg

Reputation: 369

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

iOS 15 supports captureTextFromCamera API to capture text from camera.But some devices don't supports such as iPhoneX.So How can I know this device supports captureTextFromCamera or not ?

Upvotes: 1

Views: 669

Answers (2)

Roger Lee
Roger Lee

Reputation: 330

For iOS 16 Apple add a new way to check Live Text support ImageAnalyzer.isSupported

A Boolean value that indicates whether the device supports Live Text for images.

Apple Official Document: VisionKit/ImageAnalyzer/isSupported

Upvotes: 1

Tom
Tom

Reputation: 128

One simple condition:

UITextField().canPerformAction(#selector(UIResponder.captureTextFromCamera(_:))

Tests both device support and language setting support

Upvotes: 2

Related Questions