aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-01 01:36:28 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-01 11:45:44 +0530
commitbede8a17ad292120e414051a8c833543e73197a0 (patch)
tree0bb4e6ccc22f0a24580d00fa907fa59a5b6707a4 /WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
parentTunnel edit: Error out on duplicate name when creating / modifying a tunnel (diff)
downloadwireguard-apple-bede8a17ad292120e414051a8c833543e73197a0.tar.xz
wireguard-apple-bede8a17ad292120e414051a8c833543e73197a0.zip
QR Code: Error out on duplicate name
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/QRScanViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/QRScanViewController.swift7
1 files changed, 4 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift b/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
index 45f6dde..21b50e9 100644
--- a/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/QRScanViewController.swift
@@ -6,7 +6,7 @@ import CoreData
import UIKit
protocol QRScanViewControllerDelegate: class {
- func scannedQRCode(tunnelConfiguration: TunnelConfiguration, qrScanViewController: QRScanViewController)
+ func addScannedQRCode(tunnelConfiguration: TunnelConfiguration, qrScanViewController: QRScanViewController, completionHandler: (() ->Void)?)
}
class QRScanViewController: UIViewController {
@@ -119,8 +119,9 @@ class QRScanViewController: UIViewController {
if (title.isEmpty) { return }
tunnelConfiguration.interface.name = title
if let s = self {
- s.delegate?.scannedQRCode(tunnelConfiguration: tunnelConfiguration, qrScanViewController: s)
- s.dismiss(animated: true, completion: nil)
+ s.delegate?.addScannedQRCode(tunnelConfiguration: tunnelConfiguration, qrScanViewController: s) {
+ s.dismiss(animated: true, completion: nil)
+ }
}
}))
present(alert, animated: true)