swiftui navigation title color code example
Example 1: swift navigation bar title color
let attrs = [
NSAttributedString.Key.foregroundColor: UIColor.white
]
UINavigationBar.appearance().titleTextAttributes = attrs
Example 2: swift change navigation bar title
let attrs = [
NSAttributedString.Key.foregroundColor: UIColor.white,
NSAttributedString.Key.font: UIFont(name: "Futura-Bold", size: 17)!
]
UINavigationBar.appearance().titleTextAttributes = attrs
Example 3: navigation title bar color swftui
init() {
let navBarAppearance = UINavigationBar.appearance()
navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
}