aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-23 12:51:05 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-23 14:48:45 +0530
commit77d4a02139b788362aa4027a81949d8a13e50da3 (patch)
tree2b65c49f11691ada907a61c0b2717138aafe707c /WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift
parentmacOS: reload: Iterate in reverse (diff)
downloadwireguard-apple-77d4a02139b788362aa4027a81949d8a13e50da3.tar.xz
wireguard-apple-77d4a02139b788362aa4027a81949d8a13e50da3.zip
iOS: Fix handling of deletion outside app
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift24
1 files changed, 0 insertions, 24 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift
index ac04151c..48cb7b03 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/MainViewController.swift
@@ -8,7 +8,6 @@ class MainViewController: UISplitViewController {
var tunnelsManager: TunnelsManager?
var onTunnelsManagerReady: ((TunnelsManager) -> Void)?
var tunnelsListVC: TunnelsListTableViewController?
- private var foregroundObservationToken: AnyObject?
init() {
let detailVC = UIViewController()
@@ -57,29 +56,6 @@ class MainViewController: UISplitViewController {
self.onTunnelsManagerReady?(tunnelsManager)
self.onTunnelsManagerReady = nil
}
-
- foregroundObservationToken = NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: OperationQueue.main) { [weak self] _ in
- guard let self = self else { return }
- self.tunnelsManager?.reload { [weak self] hasChanges in
- guard let self = self, let tunnelsManager = self.tunnelsManager, hasChanges else { return }
-
- self.tunnelsListVC?.setTunnelsManager(tunnelsManager: tunnelsManager)
-
- if self.isCollapsed {
- (self.viewControllers[0] as? UINavigationController)?.popViewController(animated: false)
- } else {
- let detailVC = UIViewController()
- detailVC.view.backgroundColor = .white
- let detailNC = UINavigationController(rootViewController: detailVC)
- self.showDetailViewController(detailNC, sender: self)
- }
-
- if let presentedNavController = self.presentedViewController as? UINavigationController, presentedNavController.viewControllers.first is TunnelEditTableViewController {
- self.presentedViewController?.dismiss(animated: false, completion: nil)
- }
- }
-
- }
}
}