The Startup
Published in

The Startup

Managing Multiple NavigationBars in SwiftUI

After exploring SwiftUI for quite a while, one of the most cumbersome things I encounter is to manage multiple kinds of navigation bars in an app.

Thankfully, we have ViewModifier, which allows you to create your own custom modifiers like .padding() and .font(). In this short article, I will show you a common design where a main view and a modal have different navigation bars. In this case, you are managing two separate navigation views.

This is how the app looks like:

--

--

--

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +756K followers.

Recommended from Medium

Top 3 Swift Animation Libraries for Your iOS App

How to Persist Sensitive Data Using Keychain in Swift

Core ML On-Device Training, with Transfer Learning from Swift for TensorFlow Models

Continuous Integration: CI/CD for iOS on Azure DevOps (Part 1)

Implementing Builder Pattern to create Navigation Stack for UIViewController on iOS

iOS: SF Symbols Quick Guide

Protocol Oriented Automation

Working with Internet Connection on iOS with Swift: Best Practices

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lawrence Tan

Lawrence Tan

Googler. Loves God, Loves my wife, Loves my Family & Corgis.

More from Medium

SwiftUI: A Better Way To Account For Users Opting For “Reduce Motion”

Explicit Animation in SwiftUI 🪄

How to add Tab into SwiftUI App?

How to Implement Universal Link in SwiftUI App