Using environmentObject in watchOS
问题 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. I created a new DataModel class import Combine import Foundation import SwiftUI final class DataModel: BindableObject { let didChange = PassthroughSubject<DataModel,Never>() var aString: String = "" { didSet { didChange.send(self) } } } In my ContentView struct I bind this class using @EnvironmentObject - struct ContentView : View {