0PricingLogin
SwiftUI Academy · Lesson

Toolbar & Navigation Title

Add titles and toolbar buttons to bars.

Naming the Screen

Every screen deserves a clear name. The navigationTitle modifier puts a heading in the navigation bar so users always know where they are. 🧭

.navigationTitle("Inbox")

Where the Title Goes

Attach navigationTitle to the content inside the NavigationStack, not to the stack itself. The bar then reads the title from the current screen.

NavigationStack {
    List { }
        .navigationTitle("Inbox")
}

All lessons in this course

  1. Pushing Screens with NavigationLink
  2. Passing Data to Detail Views
  3. Toolbar & Navigation Title
  4. Programmatic Navigation Paths
← Back to SwiftUI Academy