Modern SwiftUI: Navigation, Part 1

Episode #215 • Dec 5, 2022 • Subscriber-Only

We begin to layer on behavior in our rewrite of Apple’s “Scrumdinger” demo application, starting with navigation. We will do some upfront work to model it in our application state, as concisely as possible, to avoid a whole class of bugs, unlock deep linking, and enable testability.

Navigation, Part 1
Introduction
00:05
Adding and editing standups
00:50
Focus state and testing
17:51
Next time: standup details
34:17

Unlock This Episode

Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.

Introduction

OK, things are looking pretty good. We’ve got our first bit of visuals coming through, but so far this is just an inert view with no behavior. We just have some data in the view, and we construct the view hierarchy to display it.

Things start to get more interesting once we layer on behavior in an application. The first bit of behavior we will concentrate on is navigation. We need to be able to bring up sheets, drill down to screens, and show alerts. And you may think those 3 things sound quite different, but we will show that they can be modeled in the same way.

And as soon as we start navigating around to different screens, things start getting a lot more complicated. We need to start thinking about how to best model our domains, and we need to think about how parent and child domains can communicate with each other.

This episode is for subscribers only.

Subscribe to Point-Free

Access this episode, plus all past and future episodes when you become a subscriber.

See plans and pricing

Already a subscriber? Log in

Exercises

  1. Refactor Standup.attendees to be a NonEmpty collection using the NonEmpty package.

References

Getting started with Scrumdinger

Apple

Learn the essentials of iOS app development by building a fully functional app using SwiftUI.

Standups App

Brandon Williams & Stephen Celis

A rebuild of Apple’s “Scrumdinger” application that demosntrates how to build a complex, real world application that deals with many forms of navigation (e.g., sheets, drill-downs, alerts), many side effects (timers, speech recognizer, data persistence), and do so in a way that is testable and modular.

SwiftUI Navigation

Brandon Williams & Stephen Celis • Tuesday Sep 7, 2021

A library we open sourced. Tools for making SwiftUI navigation simpler, more ergonomic and more precise.

NonEmpty

Brandon Williams & Stephen Celis • Wednesday Jul 25, 2018

NonEmpty is one of our open source projects for expressing a type safe, compiler proven non-empty collection of values.

Packages authored by Point-Free

Swift Package Index

These packages are available as a package collection, usable in Xcode 13 or the Swift Package Manager 5.5.

Downloads