I am trying to use environmentObject
in a watchOS6 app to bind my data model to my view.
I have created a simple, stand-alone Watch app in Xcode 11.
Adding to Matteo's awesome answer,
If you want to use delegate then use like this:
class HostingController : WKHostingController {
override var body: AnyView {
var contentView = ContentView()
contentView.environmentObject(DataModel())
contentView.delegate = self
let contentWrapperView = AnyView(contentView)
return contentWrapperView
}
}