diff options
author | Roopesh Chander <roop@roopc.net> | 2018-10-25 11:14:38 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-10-27 15:13:02 +0530 |
commit | f7feb18ea88d4a9fa83854fc720eadfb26d79fce (patch) | |
tree | b963ccf012093e9a0c9ff34f2502cc5452bfb047 /WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift | |
parent | Import: Support for opening a .conf file in the app (diff) | |
download | wireguard-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.swift | 8 |
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) { |