Tunnel edit: init() need not take a tunnelConfiguration argument

This commit is contained in:
Roopesh Chander 2018-12-19 16:30:34 +05:30
parent d36b764e20
commit d82aedebbd
2 changed files with 5 additions and 6 deletions

View File

@ -55,12 +55,11 @@ class TunnelEditTableViewController: UITableViewController {
loadSections()
}
init(tunnelsManager: TunnelsManager, tunnelConfiguration: TunnelConfiguration?) {
init(tunnelsManager: TunnelsManager) {
// Use this initializer to create a new tunnel.
// If tunnelConfiguration is passed, data will be prepopulated from that configuration.
self.tunnelsManager = tunnelsManager
tunnel = nil
tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnelConfiguration)
tunnelViewModel = TunnelViewModel(tunnelConfiguration: nil)
activateOnDemandSetting = ActivateOnDemandSetting.defaultSetting
super.init(style: .grouped)
loadSections()

View File

@ -110,7 +110,7 @@ class TunnelsListTableViewController: UIViewController {
let createFromScratchAction = UIAlertAction(title: "Create from scratch", style: .default) { [weak self] _ in
if let self = self, let tunnelsManager = self.tunnelsManager {
self.presentViewControllerForTunnelCreation(tunnelsManager: tunnelsManager, tunnelConfiguration: nil)
self.presentViewControllerForTunnelCreation(tunnelsManager: tunnelsManager)
}
}
alert.addAction(createFromScratchAction)
@ -136,8 +136,8 @@ class TunnelsListTableViewController: UIViewController {
present(settingsNC, animated: true)
}
func presentViewControllerForTunnelCreation(tunnelsManager: TunnelsManager, tunnelConfiguration: TunnelConfiguration?) {
let editVC = TunnelEditTableViewController(tunnelsManager: tunnelsManager, tunnelConfiguration: tunnelConfiguration)
func presentViewControllerForTunnelCreation(tunnelsManager: TunnelsManager) {
let editVC = TunnelEditTableViewController(tunnelsManager: tunnelsManager)
let editNC = UINavigationController(rootViewController: editVC)
editNC.modalPresentationStyle = .formSheet
present(editNC, animated: true)