Reputation: 71
I am working with Swift and trying to set the title of a navigation controller bar. I've tried the following code snippets but of no use of all of the following statements.
self.navigationItem.title = "Test "
self.title = "Test "
self.parent?.title = "Test "
I can only see a minor horizontal Line in Nav bar. Here are the attached snippets of nav bar part only. Please look it over and suggest any kind of solution. Why isn't the title appearing in the nav bar?
And second snapshot is this one:
Upvotes: 0
Views: 1033
Reputation: 8328
It should work using following
self.navigationBar.topItem?.title = "Test"
But it's really important to understand your ViewController hierarchy. So please add more informations in further questions.
Upvotes: 1