I am new to SwiftUI and currently building my first app. However, I am having an issue.
I am programming a multi-view app, in which I would like to use kind of global variables to be able to access and edit them from all my views. For example, I ask the user his "sex", "weight" and "license" at app launch. But, I would also like him to be able to change his details in the "settings" category (being a different view). At the same time, I would like to use the same variables in both the views and make them update in both views. Like basic global variables. Is there a way to do so ?
I have watched an outdated video about @State, @ObservableObject, and @EnvironmentObject. Spoiler alert: I didn't understand. I hope you'll be able to help me. If you need any detail, feel free :) Sam