Is there a way to have a global state variable in SwiftUI? It would be nice to be able to have all my views subscribe to the same state. Is there some reason not to do this?
When I tried to declare a global variable with the @State
decorator, the swift compiler crashed (beta software, am I right?).