Post

Replies

Boosts

Views

Activity

Reply to @ObservedObject Issue
I had exactly the same problem with macOS 10.15 Beta5. Neither @ObservableObject nor @EnvironmentObject in a View (SwiftUI) worked. Changing a parameter in the observed object (or environment object) and sending the message from its objectWillChange Publisher did not result in updating the View.I could solve this problem in my code with one single line:adding "let objectWillChange: ObservableObjectPublisher = ObservableObjectPublisher()" to the observed object (environment object).Even though there is a default implementation of this variable after adding "ObservableObject" protocol declaration it seems not to work properly. After adding this line everything worked as expected. Before no message ever reached the subscribers.
Aug ’19