Decoding QR Codes via CIDetector is broken on a simulator running iOS 14.4

I was always using this snippet to import an qr image to decode it. On the simulator running iOS 14.4 qrDetector?.features... returns nil, while the same image on a device returns proper output. Any thoughts about this? Should I use different methods or is this just a possible simulator bug?

I saw that
iOS 14.4 brings improvements to QR codes and Bluetooth audio

Code Block swift
guard let ciImage = CIImage(image: image) else { return nil }
let detectorOptions = [CIDetectorAccuracy: CIDetectorAccuracyHigh]
let qrDetector = CIDetector(ofType: CIDetectorTypeQRCode, context: CIContext(), options: detectorOptions)
let decoderOptions = [CIDetectorImageOrientation: ciImage.properties[(kCGImagePropertyOrientation as String)] ?? 1]
let features = qrDetector?.features(in: ciImage, options: decoderOptions)
return (features?.first as? CIQRCodeFeature)?.messageString


Try to change accuracy.
I read there were recent improvement to QRCode, to read smaller images.

In any case, you should file a bug report.
Decoding QR Codes via CIDetector is broken on a simulator running iOS 14.4
 
 
Q