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




Peter Witham
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.



Related Reads
Podcast: Season 1 Episode 11

Source control is something everyone should be practicing. Maybe you know the term but not the reaso...


November 11, 2019 · 1 min read

Related Reads
First Serious SwiftUI Learning

This week I decided it was time to put macOS Catalina on one of my machines, the only reason I wante...


November 02, 2019 · 2 min read

Related Reads
Easy Way to Check for 32bit Apps on macOS

I have started to review my systems for macOS Catalina upgrades, that’s not to say I’m about to dive...


October 16, 2019 · 2 min read

Related Reads
Podcast: Season 1 Episode 10

I feel it is time for a discussion on the release cycle of Apple software, are they trying to meet i...


October 13, 2019 · 1 min read

Related Reads
Creating a Master Detail View with Navigation

The ProblemYou are creating an application using SwiftUI and need to have a master detail view with ...


September 29, 2019 · 1 min read

Related Reads
Podcast: Season 1 Episode 9

Some thoughts about the new OS releases from Apple for the i devices.Plus, are you backing up that i...


September 25, 2019 · 1 min read

Related Reads
The Great Reworking Begins

With the now released iOS 13.0 and the pending release on Tuesday Sept. 24th 2019 of iPadOS 13.1 and...


September 23, 2019 · 2 min read

Related Reads
Podcast: Season 1 Episode 8

All the new hardware announcements from Apple.Apple Watch Series 57th Generation iPadiPhone 11 and M...


September 10, 2019 · 1 min read

Related Reads
Podcast: Season 1 Episode 7

This week, Apple sent out invitations to the September event, as usual we expect it to be iPhones an...


September 02, 2019 · 1 min read

Related Reads
Using a UIPickerView as input for another control

The ProblemYou want to offer a pre-selected list of options to a user. This helps protect the conten...


August 30, 2019 · 1 min read

Related Reads
Podcast: Season 1 Episode 6

In this episode I talk about the state of the beta releases for the platforms and the developer tool...


August 25, 2019 · 1 min read

Related Reads
Podcast: Season 1 Episode 5

Swift Package Manager Grows Up?Xcode 11 will give us integration with the Swift Package Manager. Jus...


July 31, 2019 · 1 min read

Related Reads
Podcast: Season 1 Episode 4

I spent some time with SwiftUI.SwiftUI is the new layout kid on the block, let’s take a look and see...


July 31, 2019 · 1 min read

Related Reads
Podcast: Season 1 Episode 3

App Store Connect and TestFlight get an overhaulIn this episode we take a look at the changes announ...


July 31, 2019 · 3 min read

Related Reads
Podcast: Season 1 Episode 2

Xcode 11 has a lot to offerAll the new changes and features coming to Xcode 11, well the more obviou...


July 31, 2019 · 1 min read

Related Reads
Podcast: Season 1 Episode 1

Welcome to the Podcast / WWDC19It finally happened, it took me a while to get enough courage togethe...


July 30, 2019 · 2 min read

Related Reads
Introduction

Back when Apple announced the Swift programming language at WWDC 2014, I immediately started learnin...


July 05, 2019 · 2 min read