@EnvironmentObject in Views May Not be a Good Idea But Avoiding Them is Probably Much Worse
In SwiftUI, @EnvironmentObject
allows you to create global state that can be shared and manipulated from any view in your application. We tend to put @EnvironmentObject in our views and directly access the global state. This creates a tight coupling between the view and the @EnvironmentObject
, but avoiding this approach opens up a…