diff --git a/ios/Sources/DateScanView.swift b/ios/Sources/DateScanView.swift index e90a2d4..5bb420a 100644 --- a/ios/Sources/DateScanView.swift +++ b/ios/Sources/DateScanView.swift @@ -99,7 +99,10 @@ struct TextScanView: View { ZStack(alignment: .bottom) { if Self.isSupported { TextLinesScannerRepresentable { erkannt in - for t in erkannt.reversed() { + // Ein erkannter Textblock kann mehrere Zeilen umfassen – strikt + // in einzelne Zeilen zerlegen, damit jede Auswahl genau eine ist. + let einzeln = erkannt.flatMap { $0.components(separatedBy: .newlines) } + for t in einzeln.reversed() { let sauber = t.trimmingCharacters(in: .whitespacesAndNewlines) guard sauber.count >= 2, !zeilen.contains(sauber) else { continue } zeilen.insert(sauber, at: 0)