I have a blueView that i want to cover the large title area (Fav10) within the navigation bar. But I have trouble accessing it. Setting the navBar's topItem.titleView to my blueView just gives me 2 titles. How do I go about customizing this area?
override func viewDidLoad() {
super.viewDidLoad()
setupNavBar()
}
private func setupNavBar() {
navigationItem.title = "Fav 10"
let blueView = UIView()
blueView.backgroundColor = .blue
blueView.frame.size = CGSize(width: 40, height: 40)
navigationController?.navigationBar.isTranslucent = false
navigationController?.navigationBar.topItem!.titleView = blueView
navigationController?.navigationBar.prefersLargeTitles = true
}