SwiftUI: The UnsafeObservedObject Quiz

Do you know when it’s safe to use ObservedObject? Are you sure?

Michael Long
Better Programming
Published in
8 min readApr 2, 2023

--

Photo by Nguyen Dang Hoang Nhu on Unsplash

I’m seeing a lot more SwiftUI code recently, and that’s great!

But I’m also seeing a lot of code online in projects and in PRs that tells me quite a few people still don’t understand the difference between ObservedObject and StateObject. Or when it’s safe to use…

--

--

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.