I ran into a strange problem:
- I have a two view controllers - list, and detail.
- When I push Detail from List, navigation bar is in colapsed mode.
- To make title appear large, I have to scroll down.
ListViewController:
...
override func viewDidLoad() {
super.viewDidLoad()
setupNavigationBar()
}
private func setupNavigationBar() {
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.largeTitleDisplayMode = .never
}
...
DetailViewController:
...
override func viewDidLoad() {
super.viewDidLoad()
setupNavigationBar()
}
private func setupNavigationBar() {
title = "Bangkok ⇄ Phuket"
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.largeTitleDisplayMode = .always
}
...
After some investigation, I found out that the bug oocurs only when I put certain characters in the title:
- When the title is "Bangkok → Phuket", everything works as expected
- When the title is "Bangkok ⇄ Phuket", pushed controller's title is collapsed
Do you guys know what are the restrictions for characters in title, or any ideas how to solve it? Thank you, any help much appreciated