Fix QR code scanner cannot be cancelled

This commit is contained in:
Bob Sun 2017-10-09 20:33:18 -07:00
parent eb86b4cb05
commit 79744fc713
2 changed files with 4 additions and 2 deletions

View file

@ -682,7 +682,7 @@
<navigationItem key="navigationItem" title="Scan OTP QR Codes" id="Hlb-5I-bfE">
<barButtonItem key="leftBarButtonItem" systemItem="cancel" id="KBZ-N2-OGE">
<connections>
<segue destination="0gD-ix-2NF" kind="unwind" unwindAction="cancelOTPScannerWithSegue:" id="nZe-B6-MNt"/>
<action selector="pressCancel:" destination="A9p-Qb-WmU" id="SYK-Qh-Cs7"/>
</connections>
</barButtonItem>
</navigationItem>
@ -691,7 +691,6 @@
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="rqh-SR-bIq" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="0gD-ix-2NF" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="7059" y="-1012"/>
</scene>

View file

@ -14,6 +14,9 @@ class OTPScannerController: QRScannerController {
var scannedOTP: String?
@IBAction func pressCancel(_ sender: UIBarButtonItem) {
navigationController?.popViewController(animated: true)
}
// MARK: - AVCaptureMetadataOutputObjectsDelegate Methods
func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [Any]!, from connection: AVCaptureConnection!) {