diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-09-01 19:29:00 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-09-03 19:45:31 +0200 |
| commit | a72a048028c009c543e886b69d84e26ed78baf32 (patch) | |
| tree | 712c416f2abcad8e7c0cb9b080353063c159d98d | |
| parent | ef2a23f3fce347f6961f6e904d8aa94704317fbd (diff) | |
| download | mullvadvpn-a72a048028c009c543e886b69d84e26ed78baf32.tar.xz mullvadvpn-a72a048028c009c543e886b69d84e26ed78baf32.zip | |
RootContainer: add popToRootViewController
| -rw-r--r-- | ios/MullvadVPN/RootContainerViewController.swift | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ios/MullvadVPN/RootContainerViewController.swift b/ios/MullvadVPN/RootContainerViewController.swift index 51229183a6..20013017e8 100644 --- a/ios/MullvadVPN/RootContainerViewController.swift +++ b/ios/MullvadVPN/RootContainerViewController.swift @@ -151,6 +151,12 @@ class RootContainerViewController: UIViewController { setViewControllersInternal(newViewControllers, isUnwinding: false, animated: animated) } + func popToRootViewController(animated: Bool) { + if let rootController = self.viewControllers.first, self.viewControllers.count > 1 { + setViewControllersInternal([rootController], isUnwinding: true, animated: animated) + } + } + /// Request the root container to query the top controller for the new header bar style func updateHeaderBarAppearance() { updateHeaderBarStyleFromChildPreferences(animated: UIView.areAnimationsEnabled) |
