Observation in Practice

Episode #256 • Nov 6, 2023 • Subscriber-Only

We take all we’ve learned about the Observation framework and apply it to a larger, more real world application: our rewrite of Apple’s Scrumdinger demo. We’ll see what changes are easy to make, what changes are a bit trickier, and encounter a bug that you’ll want to know about.

Previous episode
Observation in Practice
Introduction
00:05
SyncUps tour
01:19
Observable SyncUps
11:48
Converting non-leaf features
18:53
Over observation bugs
37:17
Stack based refactor
46:22

Unlock This Episode

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

Introduction

Brandon: For the last four weeks we have gone deep into the new Observation framework in Swift 5.9. We’ve seen what it takes to use the tools, we’ve looked at the actual source code of the tools to roughly understand how they work, and we’ve even discussed a variety of gotchas and things to be aware of when using the tools.

But in those episodes we didn’t really build anything real world with the new tools. The little demo app we created served as a nice testbed for understanding observability, but in the real world we come across much different problems.

Stephen: So, it would be nice if we could see what it looks like to use these tools in a moderately complex, real world application. And luckily for us we actually built such an application over the course of 7 episodes where we discussed modern SwiftUI concepts. This included things like navigation, side effects, domain modeling, controlling dependencies and testing.

And to show off these techniques we re-built a fun application that Apple released as demo code a few years back called Scrumdinger. And after that series finished we even open sourced our version of the Scrumdinger so that we could show what we think goes into making a modern SwiftUI application.

Brandon: However, that series was done before we had these new observation tools, so perhaps we can take that code base and update it to use observability.

Let’s take a look.

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

Collection: Modern SwiftUI

Brandon Williams & Stephen Celis • Monday Nov 28, 2022

The original series in which we build the application refactored in this episode.

What does it take to build a vanilla SwiftUI application with best, modern practices? We rebuild Apple’s Scrumdinger code sample, a decently complex application that tackles real world problems, in a way that can be tested, modularized, and uses all of Swift’s powerful domain modeling tools.

Downloads