diff options
author | Roopesh Chander <roop@roopc.net> | 2018-10-17 15:33:06 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-10-27 15:13:01 +0530 |
commit | 6de354b4c5608282fe545884215ca4d273e8d221 (patch) | |
tree | 9e6355f0c8330f6669c1b8cec891a42ef86aff1b /WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | |
parent | Tunnels list: Show data from the tunnels manager (diff) | |
download | wireguard-apple-6de354b4c5608282fe545884215ca4d273e8d221.tar.xz wireguard-apple-6de354b4c5608282fe545884215ca4d273e8d221.zip |
Tunnels list: Show an actions list when the '+' is tapped
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift index 6fb7799..f9c7ff4 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift @@ -36,7 +36,20 @@ class TunnelsListTableViewController: UITableViewController { } @objc func addButtonTapped(sender: UIBarButtonItem!) { - print("Add button tapped") + let alert = UIAlertController(title: "", + message: "Add a tunnel", + preferredStyle: .actionSheet) + alert.addAction( + UIAlertAction(title: "Create from scratch", style: .default) { (action) in + print("Write") + } + ) + alert.addAction( + UIAlertAction(title: "Cancel", style: .cancel) + ) + // popoverPresentationController will be nil on iPhone and non-nil on iPad + alert.popoverPresentationController?.barButtonItem = self.navigationItem.rightBarButtonItem + self.present(alert, animated: true, completion: nil) } } |