From 2c73c8b1357e81b3715bcbad77dd6a35d693cae6 Mon Sep 17 00:00:00 2001 From: Nathan Fallet Date: Mon, 29 Aug 2022 10:12:09 +0200 Subject: [PATCH] Fixing build on simulator --- Sources/CodeScanner/ScannerViewController.swift | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Sources/CodeScanner/ScannerViewController.swift b/Sources/CodeScanner/ScannerViewController.swift index 9660894..c34ba56 100644 --- a/Sources/CodeScanner/ScannerViewController.swift +++ b/Sources/CodeScanner/ScannerViewController.swift @@ -119,14 +119,11 @@ extension CodeScannerView { } override public func touchesBegan(_ touches: Set, with event: UIEvent?) { - guard let simulatedData = delegate?.parent.simulatedData else { - print("Simulated Data Not Provided!") - return - } - // Send back their simulated data, as if it was one of the types they were scanning for - let result = ScanResult(string: simulatedData, type: delegate?.parent.codeTypes.first ?? .qr) - delegate?.found(result) + found(ScanResult( + string: parentView.simulatedData, + type: parentView.codeTypes.first ?? .qr + )) } #else