]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
QR code: QR code scanning is not available in the simulator
authorRoopesh Chander <roop@roopc.net>
Tue, 30 Oct 2018 13:52:24 +0000 (19:22 +0530)
committerRoopesh Chander <roop@roopc.net>
Tue, 30 Oct 2018 13:52:24 +0000 (19:22 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift

index 42ff8d253237b09bea1ee2fc7c31c58ad498dd80..209ada8aaa0480c40e2e9e1a8f1fb6b7fb2a1f0b 100644 (file)
@@ -113,11 +113,17 @@ class TunnelsListTableViewController: UITableViewController {
     }
 
     func presentViewControllerForScanningQRCode() {
+        #if targetEnvironment(simulator)
+        print("Scanning QR code is unavailable in the simulator")
+        #else
+
         let scanQRCodeVC = QRScanViewController()
         scanQRCodeVC.delegate = self
         let scanQRCodeNC = UINavigationController(rootViewController: scanQRCodeVC)
         scanQRCodeNC.modalPresentationStyle = .fullScreen
         self.present(scanQRCodeNC, animated: true)
+
+        #endif
     }
 
     func showErrorAlert(title: String, message: String) {