Observation: The Gotchas

Episode #254 • Oct 23, 2023 • Subscriber-Only

While the @Observable macro improves upon nearly every aspect of the @State and @ObservedObject property wrappers, it is not without its pitfalls. We will explore several gotchas that you should be aware of when adopting observation in your applications.

Previous episode
The Gotchas
Gotcha: withObservationTracking
Gotcha: Value types
Gotcha: Reference types
Gotcha: Value/reference equatability/hashability
Gotcha: Testing
Gotcha: Spooky action at a distance
Gotcha: A new era of reference types
Next time: The future

Unlock This Episode

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


Brandon: And theoretically it would even be possible to backport all of this code to work on iOS 16 and earlier. However, you wouldn’t be able to backport the SwiftUI support. That unfortunately requires iOS 17.

Stephen: OK, we have no gone deep into the new Observation framework. We understand the problems it’s trying to solve, and see concretely just how magical it can be to use it. But we’ve also explored its primary observation tracking tool, and even dug into the actual source code to see how it the tool roughly works.

The tool is pretty incredible to use, and solves so many pain points of the original tools, but it does have some gotchas and problems of its own. It is very important to understand these downsides otherwise you can easily find yourself in a situation where you are accidentally observing far too much state.

Let’s dig in.

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