summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN/CustomNavigationBar.swift6
-rw-r--r--ios/MullvadVPN/CustomSplitViewController.swift21
-rw-r--r--ios/MullvadVPN/SelectLocationNavigationController.swift10
-rw-r--r--ios/MullvadVPN/SelectLocationViewController.swift4
-rw-r--r--ios/MullvadVPN/SettingsNavigationController.swift10
5 files changed, 46 insertions, 5 deletions
diff --git a/ios/MullvadVPN/CustomNavigationBar.swift b/ios/MullvadVPN/CustomNavigationBar.swift
index 51a7655254..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
@@ -69,7 +70,10 @@ class CustomNavigationBar: UINavigationBar {
backIndicatorImage = customBackIndicatorImage
backIndicatorTransitionMaskImage = customBackIndicatorTransitionMask
barTintColor = .secondaryColor
- titleTextAttributes = [.foregroundColor: UIColor.white]
+
+ let titleAttributes: [NSAttributedString.Key: Any] = [.foregroundColor: UIColor.white]
+ titleTextAttributes = titleAttributes
+ largeTitleTextAttributes = titleAttributes
shadowImage = UIImage()
}
}
diff --git a/ios/MullvadVPN/CustomSplitViewController.swift b/ios/MullvadVPN/CustomSplitViewController.swift
index 8f85e7064c..662eef869b 100644
--- a/ios/MullvadVPN/CustomSplitViewController.swift
+++ b/ios/MullvadVPN/CustomSplitViewController.swift
@@ -32,6 +32,27 @@ class CustomSplitViewController: UISplitViewController, RootContainment {
}
}
+ override var childForStatusBarStyle: UIViewController? {
+ if #available(iOS 13, *) {
+ return super.childForStatusBarStyle
+ } else {
+ return viewControllers.last
+ }
+ }
+
+ override var childForStatusBarHidden: UIViewController? {
+ if #available(iOS 13, *) {
+ return super.childForStatusBarHidden
+ } else {
+ return viewControllers.last
+ }
+ }
+
+ override var shouldAutomaticallyForwardAppearanceMethods: Bool {
+ // iOS 12: force split view controller to forward appearance events.
+ return true
+ }
+
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
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/SelectLocationViewController.swift b/ios/MullvadVPN/SelectLocationViewController.swift
index 3b672c2c09..b0730a53ad 100644
--- a/ios/MullvadVPN/SelectLocationViewController.swift
+++ b/ios/MullvadVPN/SelectLocationViewController.swift
@@ -36,6 +36,10 @@ class SelectLocationViewController: UIViewController, UITableViewDelegate {
}
}
+ override var preferredStatusBarStyle: UIStatusBarStyle {
+ return .lightContent
+ }
+
weak var delegate: SelectLocationViewControllerDelegate?
var scrollToSelectedRelayOnViewWillAppear = true
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