Michael Long
Jan 12, 2024

--

I'm not positive the "binding" works as you expect, but basically there are three main issues with Observation.

1) One is that you have the exact opposite problem with values that you don't want to update the view, leading one to mark a lot of the code with ObservationIgnored.

2) StateObject is smart about how it constructs objects the first time they're used. @State is not. Oops.

3) Observation is iOS 17 only, which means most developers may get to use it around 2026 or so.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)