Skip to content

Commit a147b22

Browse files
author
Nathan Fallet
authored
Merge pull request #104 from hossinasaadi/main
2 parents 57cdc44 + b8b975a commit a147b22

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Sources/CodeScanner/ScannerViewController.swift

+8-7
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)