The Ideal TabView Behaviour With SwiftUI Navigation Stack

There are tons of articles that explain Navigation Stack, which was introduced with iOS 16, but most of these pretty much reshare what Apple’s documentation says — and are similar to the sample Colors app that Apple shared. While that’s good to grasp the basics, it’s far from enough to understand how to incorporate Navigation Stack in a real app.

By the end of this tutorial, we’ll have an enum-based approach with a concrete example explaining how to incorporate deep navigation with expected Tab view behavior.

So, let’s dive right into it by building a Tab View:

Website