Michael Long
Sep 25, 2023

--

You're going to need to explain that one. Bindings are simple closure pairs. EnvironmentObjects, otoh, require class-based lookups to the environment system.

Further, including @EnvironmentObject in your view means that your view MUST be reevaluated if the observable object changes. Binding only results in an update if the parent state changes and that change is reflected in the subview.

--

--

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