Post

Replies

Boosts

Views

Activity

Reply to Popped navigation view is still being updated
I'm sorry, I should have clarified that the code is just an example showing the problem. The code I have in my app is a lot more complex so I reduced it into a much more simple example. The "Add" button in the sample is just a simple way to force an updated on the main view. I understand that removing the binding into the SubView stops the problem but in the real app I need that binding. I have now fixed the problem by implementing the workaround using a boolean to keep track of when the view receives an onDisappear(). But the question remains: why does SwiftUI keep updating a view that is no longer showing on screen? There's something fundamental about the lifecycle of a SwiftUI view that I don't understand.
Jun ’20