How to set the title of a Navigation Bar programmatically? How to set the title of a Navigation Bar programmatically? ios ios

How to set the title of a Navigation Bar programmatically?


In your UIViewController

self.navigationItem.title = @"The title";


Swift 3 Version:

If you use a navigation bar without navigation controller, then you can try this:

navigationBar.topItem?.title = "Your Title"

Hope for help.


In viewDidLoad

  self.title = @"Title";