I\'ve looked through a few online tutorials, but nothing is working.
That\'s the code of my viewController:
import UIKit
class ViewController: UINavigat
First of all in your storyboard select your view controller and then
Editor -> Embed In -> Navigation Controller
then in your ViewController
class add
self.title = "AAA"
in your viewDidLoad
method and your code will look like:
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.title = "AAA"
}
}
You need to replace UINavigationController
with UIViewController
Select ViewController from the storyboard.
Go to the Editor and Embed with Navigation Controller
1) Select Navigation Item and set title from the storyboard.
2) By Programmatically
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Your Title"
}
}