Skip to content

Commit b8b975a

Browse files
authored
found each QR code separately in manual mode
1 parent 65cd76b commit b8b975a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Sources/CodeScanner/ScannerViewController.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,16 @@ extension CodeScannerView {
6464
let features = detector.features(in: ciImage)
6565

6666
for feature in features as! [CIQRCodeFeature] {
67-
qrCodeLink += feature.messageString!
68-
}
67+
qrCodeLink = feature.messageString!
68+
if qrCodeLink == "" {
69+
didFail(reason: .badOutput)
70+
} else {
71+
let result = ScanResult(string: qrCodeLink, type: .qr, image: qrcodeImg)
72+
found(result)
73+
}
6974

70-
if qrCodeLink == "" {
71-
didFail(reason: .badOutput)
72-
} else {
73-
let result = ScanResult(string: qrCodeLink, type: .qr, image: qrcodeImg)
74-
found(result)
7575
}
76+
7677
} else {
7778
print("Something went wrong")
7879
}

0 commit comments

Comments
 (0)