iOS 16 native scan code rectOfInterest setting failed

I set rectOfInterest to AVCaptureMetadataOutput, which is a rectangular box. iOS15 has always been useful. After upgrading to iOS16, it doesn't work. Can only be in the middle of the screen, which is not what I want, does anyone know how to fix this? Looking for your help~

Answered by aCoderrr in 728824022

I also encountered the same problem, on iOS16, it seems that the QR code cannot be set at the same time as the barcode. //

self.output.metadataObjectTypes=@[AVMetadataObjectTypeQRCode,
                 AVMetadataObjectTypeEAN13Code,
                 AVMetadataObjectTypeEAN8Code,
                 AVMetadataObjectTypeUPCECode,
                 AVMetadataObjectTypeCode39Code,
                 AVMetadataObjectTypeCode39Mod43Code,
                 AVMetadataObjectTypeCode93Code,
                 AVMetadataObjectTypeCode128Code,
                 AVMetadataObjectTypePDF417Code,
                 AVMetadataObjectTypeDataMatrixCode];

// Before iOS15, I set it like this and it worked fine. After iOS16, it fails.

I removed, AVMetadataObjectTypeQRCode AVMetadataObjectTypeDataMatrixCode, it can correctly identify the barcode.

But before iOS15, QR code and barcode are used at the same time, this is a bug of iOS16 system, I hope to get professional answers from Apple developers, thank you!

To be precise, the barcode recognition range is only in the middle of the screen, and the QR code is not affected.

Accepted Answer

I also encountered the same problem, on iOS16, it seems that the QR code cannot be set at the same time as the barcode. //

self.output.metadataObjectTypes=@[AVMetadataObjectTypeQRCode,
                 AVMetadataObjectTypeEAN13Code,
                 AVMetadataObjectTypeEAN8Code,
                 AVMetadataObjectTypeUPCECode,
                 AVMetadataObjectTypeCode39Code,
                 AVMetadataObjectTypeCode39Mod43Code,
                 AVMetadataObjectTypeCode93Code,
                 AVMetadataObjectTypeCode128Code,
                 AVMetadataObjectTypePDF417Code,
                 AVMetadataObjectTypeDataMatrixCode];

// Before iOS15, I set it like this and it worked fine. After iOS16, it fails.

I removed, AVMetadataObjectTypeQRCode AVMetadataObjectTypeDataMatrixCode, it can correctly identify the barcode.

But before iOS15, QR code and barcode are used at the same time, this is a bug of iOS16 system, I hope to get professional answers from Apple developers, thank you!

Why isn't this issue being resolved by Apple? It has been 8 months since the bug was reported, and we can't find an alternative solution. Could you please resolve the issue as soon as possible?

iOS 16 native scan code rectOfInterest setting failed
 
 
Q