I have a HomeViewController
which pushes to SendViewController
and the navigation bar turns from dark blue to white:
In HomeViewController.swift
:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.barStyle = .black
navigationController?.navigationBar.barTintColor = Styleguide.Colors.darkBlue.color
navigationController?.navigationBar.tintColor = Styleguide.Colors.lightBlue.color
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Styleguide.Colors.darkBlue.color
navigationController?.navigationBar.barTintColor = Styleguide.Colors.darkBlue.color
navigationController?.navigationBar.tintColor = Styleguide.Colors.lightBlue.color
navigationController?.navigationBar.isTranslucent = false
navigationController?.navigationBar.shadowImage = UIImage() // hides the bottom border
self.navigationItem.hidesBackButton = true
... more
}
In SendViewController.swift
:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.barStyle = .default
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.navigationBar.barStyle = .black
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
self.navigationController?.navigationBar.barTintColor = .white
self.navigationController?.navigationBar.tintColor = Styleguide.Colors.darkBlue.color
... more
}
Here's the problem:
When popping from Send
to Home
, the navigation bar is white and then jumps to be dark blue after animation finishes. (Desired result is an animation from white to dark blue as the pop happens)