Skip to content

Commit

Permalink
Merge pull request #83 from twostraws/simulator
Browse files Browse the repository at this point in the history
Fixing build on simulator
  • Loading branch information
nathanfallet authored Aug 29, 2022
2 parents 0568b94 + 2c73c8b commit c785971
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Sources/CodeScanner/ScannerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,11 @@ extension CodeScannerView {
}

override public func touchesBegan(_ touches: Set<UITouch>, 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
Expand Down

0 comments on commit c785971

Please sign in to comment.