IOS-2152 - Rename variable, make it public, remove unnecesary code IOS-2152
authorMartin Brude
Tue, 17 Mar 2020 13:14:14 +0100
branchIOS-2152
changeset 12309815844fd4853
parent 12304 db2d1167b327
child 12310 29782553ac3e
IOS-2152 - Rename variable, make it public, remove unnecesary code
pEpForiOS/UI/BaseClasses/BaseViewController.swift
pEpForiOS/UI/EmailDisplay/EmailDisplayList/EmailListViewController.swift
pEpForiOS/UI/Folder/FolderTableViewController.swift
pEpForiOS/UI/Login/AccountTypeSelectorViewController.swift
pEpForiOS/UI/Login/LoginViewController.swift
pEpForiOS/UI/Settings/SettingsTableViewController.swift
     1.1 --- a/pEpForiOS/UI/BaseClasses/BaseViewController.swift	Tue Mar 17 11:50:44 2020 +0100
     1.2 +++ b/pEpForiOS/UI/BaseClasses/BaseViewController.swift	Tue Mar 17 13:14:14 2020 +0100
     1.3 @@ -14,7 +14,11 @@
     1.4  class BaseViewController: UIViewController, ErrorPropagatorSubscriber {
     1.5      private var _appConfig: AppConfig?
     1.6      
     1.7 -    var needsWhiteTintColor : Bool = false
     1.8 +    /// Indicates when the navigation bar tint color must be white.
     1.9 +    /// As in iOS 13 the property to set that color changed, we use this flag to set it properly.
    1.10 +    /// Use it if for an specific view, the navigation bar tint color must be white.
    1.11 +    /// To use is, set it to true before the segue is performed.
    1.12 +    public var navigationBarTintColorWhite : Bool = false
    1.13  
    1.14      var appConfig: AppConfig! {
    1.15          get {
    1.16 @@ -36,7 +40,7 @@
    1.17      
    1.18      override func viewDidLoad() {
    1.19          super.viewDidLoad()
    1.20 -        if needsWhiteTintColor {
    1.21 +        if navigationBarTintColorWhite {
    1.22              navigationController?.navigationBar.barTintColor = UIColor.white //iOS 13
    1.23              UINavigationBar.appearance().tintColor = UIColor.white //iOS 11
    1.24          }
    1.25 @@ -44,7 +48,7 @@
    1.26  
    1.27      override func viewWillDisappear(_ animated: Bool) {
    1.28          super.viewWillDisappear(animated)
    1.29 -        if needsWhiteTintColor {
    1.30 +        if navigationBarTintColorWhite {
    1.31              navigationController?.navigationBar.barTintColor = UIColor.black
    1.32              UINavigationBar.appearance().tintColor = UIColor.pEpGreen
    1.33          }
     2.1 --- a/pEpForiOS/UI/EmailDisplay/EmailDisplayList/EmailListViewController.swift	Tue Mar 17 11:50:44 2020 +0100
     2.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailDisplayList/EmailListViewController.swift	Tue Mar 17 13:14:14 2020 +0100
     2.3 @@ -1177,7 +1177,7 @@
     2.4              }
     2.5              vc.appConfig = appConfig
     2.6              vc.loginDelegate = self
     2.7 -            vc.needsWhiteTintColor = true
     2.8 +            vc.navigationBarTintColorWhite = true
     2.9              vc.hidesBottomBarWhenPushed = true
    2.10              break
    2.11          case .segueFolderViews:
     3.1 --- a/pEpForiOS/UI/Folder/FolderTableViewController.swift	Tue Mar 17 11:50:44 2020 +0100
     3.2 +++ b/pEpForiOS/UI/Folder/FolderTableViewController.swift	Tue Mar 17 13:14:14 2020 +0100
     3.3 @@ -256,7 +256,7 @@
     3.4                      Log.shared.errorAndCrash("Missing VCs")
     3.5                      return
     3.6              }
     3.7 -            vc.needsWhiteTintColor = true
     3.8 +            vc.navigationBarTintColorWhite = true
     3.9              nav.modalPresentationStyle = .fullScreen
    3.10              vc.appConfig = self.appConfig
    3.11              vc.hidesBottomBarWhenPushed = true
     4.1 --- a/pEpForiOS/UI/Login/AccountTypeSelectorViewController.swift	Tue Mar 17 11:50:44 2020 +0100
     4.2 +++ b/pEpForiOS/UI/Login/AccountTypeSelectorViewController.swift	Tue Mar 17 13:14:14 2020 +0100
     4.3 @@ -154,7 +154,7 @@
     4.4              vc.appConfig = appConfig
     4.5              vc.viewModel = viewModel.loginViewModel()
     4.6              vc.delegate = loginDelegate
     4.7 -            vc.needsWhiteTintColor = true
     4.8 +            vc.navigationBarTintColorWhite = true
     4.9          case .clientCertManagementSegue:
    4.10              guard let dvc = segue.destination as? ClientCertificateManagementViewController else {
    4.11                  Log.shared.errorAndCrash("Invalid state")
     5.1 --- a/pEpForiOS/UI/Login/LoginViewController.swift	Tue Mar 17 11:50:44 2020 +0100
     5.2 +++ b/pEpForiOS/UI/Login/LoginViewController.swift	Tue Mar 17 13:14:14 2020 +0100
     5.3 @@ -258,7 +258,7 @@
     5.4                      return
     5.5              }
     5.6              vc.appConfig = appConfig
     5.7 -            vc.needsWhiteTintColor = true
     5.8 +            vc.navigationBarTintColorWhite = true
     5.9              // Give the next model all that we know.
    5.10              vc.verifiableAccount = vm.verifiableAccount
    5.11          default:
     6.1 --- a/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Tue Mar 17 11:50:44 2020 +0100
     6.2 +++ b/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Tue Mar 17 13:14:14 2020 +0100
     6.3 @@ -55,7 +55,6 @@
     6.4          comment: "Settings view title")
     6.5      }
     6.6      private func setUp() {
     6.7 -        UINavigationBar.appearance().tintColor = .black
     6.8          title = Localized.navigationTitle
     6.9          tableView.register(pEpHeaderView.self,
    6.10                             forHeaderFooterViewReuseIdentifier: pEpHeaderView.reuseIdentifier)