Hi everyone, I have a ios app that updates a observable object/@Published properties, and I am wondering if there is a good way to share the data that is written to the observable object to update the views on my watch app. I have the environment added in my watch app with a @EnvironmentObject var env: Environment in the swiftui ContentView, and when I run the app I get a error:
"No ObservableObject of type GlobalEnvironmentMain found. A View.environmentObject(:) for GlobalEnvironment_Main may be missing as an ancestor of this view"
Is there a trick to making this work, is there an easy way or do I have to dig into Watch Connectivity to make it work? Is there something I have to do in the HostingController class for the app to recognized the shared environment and update views accordingly on both my iphone and watch observing the same Environment Object?
"No ObservableObject of type GlobalEnvironmentMain found. A View.environmentObject(:) for GlobalEnvironment_Main may be missing as an ancestor of this view"
Is there a trick to making this work, is there an easy way or do I have to dig into Watch Connectivity to make it work? Is there something I have to do in the HostingController class for the app to recognized the shared environment and update views accordingly on both my iphone and watch observing the same Environment Object?