In iPad, the QR code reader returns result before we can see the QR code in camera
Closed this issue · 2 comments
kuoliangkwong commented
It returns result before we can see the QR code in the camera
I noticed the camera has wider angle and managed to capture the QR code before the QR code reaches the camera UI, since the camera UI is way smaller in iPad, as shown below
Is there any way we can return result only when the QR code is within the white dotted boundary?
Sopheak0 commented
I got the same issue!
yannickl commented
I've added the feature for the next version. You'll be able to configure the scan area via the QRCodeReaderViewControllerBuilder
:
let builder = QRCodeReaderViewControllerBuilder {
$0.reader = QRCodeReader(metadataObjectTypes: [.qr], captureDevicePosition: .back)
$0.rectOfInterest = CGRect(x: 0.15, y: 0.15, width: 0.7, height: 0.7)
}
It follows the same API of the AVCaptureMetadataOut
's rectOfInterest
: https://developer.apple.com/documentation/avfoundation/avcapturemetadataoutput/1616291-rectofinterest
Now see the #106 thread please.