QR code: QR code scanning is not available in the simulator

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2018-10-30 19:22:24 +05:30
parent 900b468622
commit e13bf133db
1 changed files with 6 additions and 0 deletions

View 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) {