iOS Swift - State Management in SwiftUI
You want to share a user profile object across multiple views using @EnvironmentObject. Which steps must you follow to correctly implement this shared state?
A) Declare the profile class as ObservableObject with @Published properties.
B) Create an instance of the profile and inject it using .environmentObject() at the app root.
C) Use @EnvironmentObject in all views that need access to the profile.
D) Pass the profile instance manually to each view initializer instead of using @EnvironmentObject.
