change navigation view title swiftui code example

Example 1: swift change navigation bar title

// Place this in your didFinishLaunchingWithOptions method in the AppDelegate
let attrs = [
  NSAttributedString.Key.foregroundColor: UIColor.white, // changes color
  NSAttributedString.Key.font: UIFont(name: "Futura-Bold", size: 17)! // changes font
]

UINavigationBar.appearance().titleTextAttributes = attrs

Example 2: navigation title bar color swftui

init() {
            let navBarAppearance = UINavigationBar.appearance()
            navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
            navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
          }

Example 3: swift show title on navigation bar programmatically

override func viewDidLoad() {
     super.viewDidLoad()
     self.title = "Your title over here"
}