change the font size of a navigationview's title swiftui to footnote size in swift

You can use the font modifier with the .footnote style to change the font size of the NavigationView's title to footnote size. Here is an example:

main.swift
import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
            Text("Hello, world!")
                .navigationBarTitle("My App Title")
                .font(.footnote)
        }
    }
}
231 chars
12 lines

In this example, the font modifier is used to change the font size of the NavigationView's title to footnote size.

Note that the font modifier can be used with any of the font styles available in SwiftUI, including .largeTitle, .title, .headline, .subheadline, .body, .callout, .footnote, and .caption.

gistlibby LogSnag