change the font size of a navigationview's title swiftui not navigationbartitle in swift

To change the font size of a NavigationView's title in SwiftUI, you can use the following code:

main.swift
NavigationView {
    Text("Hello, World!")
        .font(.largeTitle) // set font size
        .navigationBarTitle("Title", displayMode: .automatic)
}
151 chars
6 lines

You just need to use the .font modifier to set the font size of the Text view that serves as the title of the NavigationView.

related categories

gistlibby LogSnag