I want to display title of my each view in tabview at the top with the text being left aligned, currently when I toggle the top titlebar in storyboard I get something like this:
But when I run my app the title isn’t displayed like this, how do I show this when the app is running??
Update 1:
I am able to show the title bar by embedding the tabview controller inside a navigationview controller. Now the only issue I have is setting the alignment of the title to left.
2
Answers
I wrote a custom extension to
UINavigationItem
that sets the title left aligned:Add this in each
UIViewController
that is used in the tabview:The tabviewcontroller has to be embedded inside navigationviewcontroller for this to work.
Try this: