Search code examples
iosswiftstoryboard

Change title of navigation bar when tab controller


First here is the layout

main.storyboad

I am trying to change the title of the navigation bar so on screen one (top - right) it says Now Playing while on the one directly below that it should say About.

However I am having an small issue doing this. You see on the tabview controller I can set it. However on the first and second views (the ones on far right) I am not able to set it.

I am wondering how I fix this?

I am using Swift + storyboards.


Solution

  • by using code you can set navigation title

    self.navigationController?.title = "abcd" 
    

    Or you can set the Title property of ViewController from stroyboard.