Post

Replies

Boosts

Views

Activity

Reply to Update of @Published array does not update view
I have been debugging a similar issue (UI become out of sync) with my app, which involves no array. With additional debugging code, I found out that the SwiftUI attempts to update the UI when some values (in @ObservedObject) change, but the new value is not yet available at that time. This is probably associated with a tricky update mechanism in SwiftUI, which uses Combine, which sends the notification before the value change. https://developer.apple.com/forums/thread/128096 My code happened to have the following code and removing this line has solved this issue. @Environment(\.presentationMode) var presentationMode
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21