From b8b975a06864137a6b86c441c00aff3e810b8444 Mon Sep 17 00:00:00 2001 From: Hossin Asaadi Date: Tue, 28 Mar 2023 15:28:42 +0400 Subject: [PATCH] found each QR code separately in manual mode --- Sources/CodeScanner/ScannerViewController.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Sources/CodeScanner/ScannerViewController.swift b/Sources/CodeScanner/ScannerViewController.swift index b21ed44..962c9e0 100644 --- a/Sources/CodeScanner/ScannerViewController.swift +++ b/Sources/CodeScanner/ScannerViewController.swift @@ -64,15 +64,16 @@ extension CodeScannerView { let features = detector.features(in: ciImage) for feature in features as! [CIQRCodeFeature] { - qrCodeLink += feature.messageString! - } + qrCodeLink = feature.messageString! + if qrCodeLink == "" { + didFail(reason: .badOutput) + } else { + let result = ScanResult(string: qrCodeLink, type: .qr, image: qrcodeImg) + found(result) + } - if qrCodeLink == "" { - didFail(reason: .badOutput) - } else { - let result = ScanResult(string: qrCodeLink, type: .qr, image: qrcodeImg) - found(result) } + } else { print("Something went wrong") }