I'm using prefersLargeTitles
on my navigation bar, When it collapse, I want to align the title to the left of the navigation bar,
What I did is I create a leftBarButtonItem
with a custom view of label and set the title color to .clear
, the problem is, that label is visible even if the large titles didn't collapsed yet.
This is my code for adding navigation item as my title
let label = UILabel()
label.textColor = UIColor.black
label.text = "my left title"
self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(customView: label)
or the other question for this post is, how can I hide the leftBarButtonItem
if the large title didn't collapsed yet?