Creating a Master Detail View with Navigation

September 29, 2019 · 1 min read

The Problem

You are creating an application using SwiftUI and need to have a master detail view with navigation between them.

The Solution

This is something that SwiftUI has really simplified, we do not need to worry about storyboards or prepareForSegue and all the code that goes with that.

It now just takes a few lines of code using a NavigationView and NavigationLink to have a working system in very little time.

The Steps

  1. Wrap the view in a NavigationView tag
  2. Add a NavigationLink tag to the item you want to touch on to perform the navigation
  3. Create the detail view that you will be navigating to during step 2

The Video




Subscribe to site
Peter Witham

Web and Mobile Software Maker, Photographer and Podcaster. I live and breath creativity.
I'd love for you to connect with me via Twitter or if you are a photo person like myself, Instagram.