From: Roopesh Chander Date: Tue, 30 Oct 2018 13:52:24 +0000 (+0530) Subject: QR code: QR code scanning is not available in the simulator X-Git-Tag: 0.0.20181104-1~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e13bf133db27c9b64cf41de123bfcfbcd2649418;p=thirdparty%2Fwireguard-apple.git QR code: QR code scanning is not available in the simulator Signed-off-by: Roopesh Chander --- diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift index 42ff8d2..209ada8 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift @@ -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) {