aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-25 11:14:38 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-27 15:13:02 +0530
commitf7feb18ea88d4a9fa83854fc720eadfb26d79fce (patch)
treeb963ccf012093e9a0c9ff34f2502cc5452bfb047 /WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
parentImport: Support for opening a .conf file in the app (diff)
downloadwireguard-apple-f7feb18ea88d4a9fa83854fc720eadfb26d79fce.tar.xz
wireguard-apple-f7feb18ea88d4a9fa83854fc720eadfb26d79fce.zip
Tunnel editing: Delegate should also report when editing is cancelled
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift8
1 files changed, 5 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
index 1c863f5..1054cfa 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
@@ -4,7 +4,8 @@
import UIKit
protocol TunnelEditTableViewControllerDelegate: class {
- func saved(tunnel: TunnelContainer)
+ func tunnelSaved(tunnel: TunnelContainer)
+ func tunnelEditingCancelled()
}
// MARK: TunnelEditTableViewController
@@ -81,8 +82,8 @@ class TunnelEditTableViewController: UITableViewController {
print("Could not modify tunnel: \(error)")
self?.showErrorAlert(title: "Could not save", message: "Internal error")
} else {
- self?.delegate?.saved(tunnel: tunnel)
self?.dismiss(animated: true, completion: nil)
+ self?.delegate?.tunnelSaved(tunnel: tunnel)
}
}
} else {
@@ -92,8 +93,8 @@ class TunnelEditTableViewController: UITableViewController {
print("Could not add tunnel: \(error)")
self?.showErrorAlert(title: "Could not save", message: "Internal error")
} else {
- self?.delegate?.saved(tunnel: tunnel)
self?.dismiss(animated: true, completion: nil)
+ self?.delegate?.tunnelSaved(tunnel: tunnel)
}
}
}
@@ -102,6 +103,7 @@ class TunnelEditTableViewController: UITableViewController {
@objc func cancelTapped() {
dismiss(animated: true, completion: nil)
+ self.delegate?.tunnelEditingCancelled()
}
func showErrorAlert(title: String, message: String) {