Michael Long
Nov 5, 2023

--

You have a mishmash going on here.

Bindable is a iOS 17-only construct designed to work with @Observable elements.

If you're making your class conform to ObservableObject with Published attributes and you're using ObservedObject, StateObject, or (as shown) EnvironmentObject, you don't need Bindable.

You would in fact use it with Observable objects provided via Environment, but the code example purporting to demonstrate that shows EnvironmentObject.

--

--

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.

No responses yet