Custom NavigationView Bar in SwiftUI

Using custom colors in the navigation bar

Ale Patrón
The Startup

--

NavigationView is SwiftUI’s counterpart to UIKit’s UINavigationController. A NavigationView is defined by Apple as “A view for presenting a stack of views representing a visible path in a navigation hierarchy”. In other words, it allows you to do hierarchical navigation between views and adds a navigation bar at the top of the screen.

SwiftUI’s default navigation bar is colored white with black text, and the opposite when dark mode is enabled.

--

--