diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-11-04 13:51:11 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-11-04 17:05:34 +0100 |
| commit | ec3c45a2a93a1c834b66512ea117c6aff68b556f (patch) | |
| tree | 3e6d4d8f28889b9e683dd2888572d1c3864493cd | |
| parent | ca01d7628d9765edba008240e5716eb64a915bd2 (diff) | |
| download | mullvadvpn-ec3c45a2a93a1c834b66512ea117c6aff68b556f.tar.xz mullvadvpn-ec3c45a2a93a1c834b66512ea117c6aff68b556f.zip | |
Implement statusbar appearance methods on navigation controller subclasses
| -rw-r--r-- | ios/MullvadVPN/CustomNavigationBar.swift | 1 | ||||
| -rw-r--r-- | ios/MullvadVPN/SelectLocationNavigationController.swift | 10 | ||||
| -rw-r--r-- | ios/MullvadVPN/SettingsNavigationController.swift | 10 |
3 files changed, 17 insertions, 4 deletions
diff --git a/ios/MullvadVPN/CustomNavigationBar.swift b/ios/MullvadVPN/CustomNavigationBar.swift index b100a7f33c..4268a45d72 100644 --- a/ios/MullvadVPN/CustomNavigationBar.swift +++ b/ios/MullvadVPN/CustomNavigationBar.swift @@ -59,6 +59,7 @@ class CustomNavigationBar: UINavigationBar { } private func setupNavigationBarAppearance() { + tintColor = .white backgroundColor = .secondaryColor isTranslucent = false diff --git a/ios/MullvadVPN/SelectLocationNavigationController.swift b/ios/MullvadVPN/SelectLocationNavigationController.swift index 3b6b8ba0a8..66a5c71fd1 100644 --- a/ios/MullvadVPN/SelectLocationNavigationController.swift +++ b/ios/MullvadVPN/SelectLocationNavigationController.swift @@ -11,12 +11,18 @@ import UIKit class SelectLocationNavigationController: UINavigationController { + override var childForStatusBarStyle: UIViewController? { + return topViewController + } + + override var childForStatusBarHidden: UIViewController? { + return topViewController + } + init(contentController: SelectLocationViewController) { super.init(navigationBarClass: CustomNavigationBar.self, toolbarClass: nil) viewControllers = [contentController] - navigationBar.barStyle = .black - navigationBar.tintColor = .white } override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { diff --git a/ios/MullvadVPN/SettingsNavigationController.swift b/ios/MullvadVPN/SettingsNavigationController.swift index f8959c927d..b594492cff 100644 --- a/ios/MullvadVPN/SettingsNavigationController.swift +++ b/ios/MullvadVPN/SettingsNavigationController.swift @@ -29,6 +29,14 @@ class SettingsNavigationController: CustomNavigationController, SettingsViewCont weak var settingsDelegate: SettingsNavigationControllerDelegate? + override var childForStatusBarStyle: UIViewController? { + return topViewController + } + + override var childForStatusBarHidden: UIViewController? { + return topViewController + } + init() { super.init(navigationBarClass: CustomNavigationBar.self, toolbarClass: nil) @@ -51,8 +59,6 @@ class SettingsNavigationController: CustomNavigationController, SettingsViewCont override func viewDidLoad() { super.viewDidLoad() - navigationBar.barStyle = .black - navigationBar.tintColor = .white navigationBar.prefersLargeTitles = true // Update account expiry |
