Why doesn't the navigation title show up using SwiftUI?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The most common reason a navigation title does not appear in SwiftUI is that .navigationTitle() is applied to the NavigationView (or NavigationStack) itself rather than to a view inside it. The title modifier must be placed on a child view within the navigation container. Other causes include missing the navigation container entirely, using deprecated APIs, or inline display mode making the title less visible. Understanding how SwiftUI's navigation modifiers attach to the view hierarchy resolves this issue immediately.
The Wrong Way (Title Does Not Show)
Placing .navigationTitle() outside the NavigationView attaches it to the parent, not the navigation bar. The navigation container does not read modifiers applied to itself.
The Right Way
The .navigationTitle() modifier must be on a view inside the NavigationView. It tells the navigation bar what title to display when that view is the current screen.
Using NavigationStack (iOS 16+)
NavigationStack replaces NavigationView starting in iOS 16. The same rule applies — .navigationTitle() goes on child views, not on NavigationStack itself.
Display Modes
.large shows a big title below the navigation bar (default for root views). .inline shows a smaller title centered in the navigation bar. If you expect a large title but see nothing, check whether .inline mode or scrolling behavior is hiding it.
Title Not Showing in Tabs
When using TabView, each tab needs its own NavigationView (or NavigationStack). Wrapping the entire TabView in a single NavigationView causes layout issues and missing titles.
Title Not Showing After Navigation
Each destination view sets its own .navigationTitle(). If the detail view does not have this modifier, the navigation bar shows an empty title when you navigate to it.
Hiding and Showing the Navigation Bar
.navigationBarHidden(true) hides the entire navigation bar including the title. If your title is not visible, check that this modifier is not applied somewhere in the view hierarchy.
Deprecated API
.navigationBarTitle() was deprecated in iOS 14. While it still works, mixing old and new APIs in the same view hierarchy can cause unexpected behavior. Use .navigationTitle() and .navigationBarTitleDisplayMode() consistently.
Common Pitfalls
- Placing .navigationTitle() on NavigationView/NavigationStack: The title modifier must be on a child view inside the navigation container. Placing it outside is the most common cause of missing titles.
- Missing NavigationView entirely:
.navigationTitle()does nothing without a parentNavigationVieworNavigationStack. The modifier only configures the navigation bar — without a navigation container, there is no navigation bar. - Wrapping TabView in a single NavigationView: This causes each tab to share one navigation stack, leading to missing or incorrect titles. Each tab should have its own
NavigationView. - Large title hidden by scroll position: Large titles collapse to inline when the user scrolls down. If your content starts scrolled, the large title may not be visible. Check that the view starts at the top.
- Conflicting .navigationBarHidden(true): If any view in the hierarchy sets
.navigationBarHidden(true), the title disappears. Search for this modifier in your code when debugging missing titles.
Summary
- Place
.navigationTitle()on a child view insideNavigationVieworNavigationStack, never on the container itself - Use
NavigationStackinstead ofNavigationViewfor iOS 16+ projects - Each
TabViewtab needs its own navigation container - Use
.navigationBarTitleDisplayMode(.large)or.inlineto control title appearance - Each navigation destination sets its own
.navigationTitle() - Use
.navigationTitle()(iOS 14+) instead of the deprecated.navigationBarTitle()

