Composable Navigation: Destinations

Episode #228 • Mar 27, 2023 • Subscriber-Only

While we just tackled drill-down navigation, sadly the API we used was deprecated in iOS 16. Let’s get things working with the new navigationDestination view modifier, and see what testing in the Composable Architecture has to say about navigation.

Destinations
Introduction
00:05
Testing links
01:19
Destinations
13:10
Next time: enum routing
29:03

Unlock This Episode

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

Introduction

Stephen: OK, I feel like we’ve said this too many times in this series of episodes but we can’t help say it again: this stuff is really incredible.

We have now built tools to support 6 different forms of navigation: alerts, confirmation dialogs, sheets, popovers, covers and now navigation links. Sure, it was the deprecated form of navigation links, but it’s still really impressive stuff.

If you’re willing to put in a little bit of upfront domain modeling work when building your features, then you get to treat all of these forms of navigation as all basically the same thing. You just have some optional state, you invoke a reducer operator to integrate a child feature with the parent, and you invoke a method in the view layer to integrate a child view with the parent.

Brandon: But once you do that there are massive benefits. Parent and child domains get a really simple way to communicate with each other. Just a moment ago we saw that the parent inventory feature could instantly see every edit made to an item inside the ItemFormFeature, and used that power in order to update the items collection instantly. And deep linking basically just comes along for free.

Testing is another super power that is unlocked once you perform the upfront work. We’ve seen this time and time again so far in this series, but let’s do it again.

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

References

Composable navigation beta GitHub discussion

Brandon Williams & Stephen Celis • Monday Feb 27, 2023

In conjunction with the release of episode #224 we also released a beta preview of the navigation tools coming to the Composable Architecture.

Downloads