aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/UI')
-rw-r--r--WireGuard/WireGuard/UI/iOS/MainViewController.swift12
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift35
2 files changed, 45 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/MainViewController.swift b/WireGuard/WireGuard/UI/iOS/MainViewController.swift
index a296b5f..4672c27 100644
--- a/WireGuard/WireGuard/UI/iOS/MainViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/MainViewController.swift
@@ -8,8 +8,16 @@
import UIKit
-class MainViewController: UIViewController {
+class MainViewController: UISplitViewController {
override func loadView() {
- self.view = UIView()
+ let detailVC = UIViewController()
+ let detailNC = UINavigationController(rootViewController: detailVC)
+
+ let masterVC = TunnelsListTableViewController()
+ let masterNC = UINavigationController(rootViewController: masterVC)
+
+ self.viewControllers = [ masterNC, detailNC ]
+
+ super.loadView()
}
}
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
new file mode 100644
index 0000000..e886e4a
--- /dev/null
+++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
@@ -0,0 +1,35 @@
+//
+// TunnelsListTableViewController.swift
+// WireGuard
+//
+// Created by Roopesh Chander on 12/10/18.
+// Copyright © 2018 Roopesh Chander. All rights reserved.
+//
+
+import UIKit
+
+class TunnelsListTableViewController: UITableViewController {
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ self.title = "WireGuard"
+ let addButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(addButtonTapped(sender:)))
+ self.navigationItem.rightBarButtonItem = addButtonItem
+ }
+
+ @objc func addButtonTapped(sender: UIBarButtonItem!) {
+ print("Add button tapped")
+ }
+}
+
+// MARK: UITableViewDataSource
+
+extension TunnelsListTableViewController {
+ override func numberOfSections(in tableView: UITableView) -> Int {
+ return 0
+ }
+
+ override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+ return 0
+ }
+}