aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift15
1 files changed, 13 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
index e3efc50..1c863f5 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
@@ -29,10 +29,21 @@ class TunnelEditTableViewController: UITableViewController {
let tunnel: TunnelContainer?
let tunnelViewModel: TunnelViewModel
- init(tunnelsManager tm: TunnelsManager, tunnel t: TunnelContainer? = nil) {
+ init(tunnelsManager tm: TunnelsManager, tunnel t: TunnelContainer) {
+ // Use this initializer to edit an existing tunnel.
tunnelsManager = tm
tunnel = t
- tunnelViewModel = TunnelViewModel(tunnelConfiguration: t?.tunnelConfiguration)
+ tunnelViewModel = TunnelViewModel(tunnelConfiguration: t.tunnelConfiguration)
+ super.init(style: .grouped)
+ self.modalPresentationStyle = .formSheet
+ }
+
+ init(tunnelsManager tm: TunnelsManager, tunnelConfiguration: TunnelConfiguration?) {
+ // Use this initializer to create a new tunnel.
+ // If tunnelConfiguration is passed, data will be prepopulated from that configuration.
+ tunnelsManager = tm
+ tunnel = nil
+ tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnelConfiguration)
super.init(style: .grouped)
self.modalPresentationStyle = .formSheet
}