For some reason, passing again the view model instance from the parent view works:
struct SettingsView: View {
@EnvironmentObject var mainModel: MainViewModel
@EnvironmentObject var authModel: AuthViewModel
@EnvironmentObject var purchaseModel: PurchaseViewModel
[some stuff]
var body: some View {
GeometryReader { geo in
[some stuff]
}
.sheet(isPresented: self.$isProfileEditPresented) {
ProfileEditView(isPresented: self.$isProfileEditPresented)
.environmentObject(authModel)
}
}
}
I don't see why this is necessary, since ProfileEditView is a child View to SettingsView, and therefore should already have access to the environment object, but passing it again solved the problem.
Post
Replies
Boosts
Views
Activity
Hi.
Yes I have it. That view model is widely used across the app and works fine everywhere else (Mac included), but gives issues only on that single view, and only on Mac.