I have a view controller that is pushed
onto a navigation stack. The stack has navigationBar.prefersLargeTitles = true
, whilst this new view controller has navigationBar.prefersLargeTitles = false
. I achieve this using the following code in the view controller that is pushed onto the stack:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.prefersLargeTitles = false
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.navigationBar.prefersLargeTitles = true
}
However, when I return back to the presenting view controller, the change in the navigation bar from navigationBar.prefersLargeTitles = false
to navigationBar.prefersLargeTitles = true
is a bit glitchy. Is there any way to make this smoother?
Many thanks