View crashes/disappears if root of NavigationViews links to view with @ViewBuilder property?

Hi,

I have just found the weirdest behaviour in SwiftUI. Here is what happens:

  1. I have a view A which contains a NavigationView.

  2. From A the user can go to view B and from there to view C.

  3. In view C the user can enter data which updates a published property of an observable object to which views A, B and C link to via @Observed Object.

  4. On updating the published property view c just disappears, without any crash report, log message or anything (And the reason why I think it crashes is because the usual animation for going forward/backward is missing when it disappears). The app doesn't crash either and can be used normally, including going back to view C.

  5. If I remove the link to the observed object in view A OR if I remove some code from view A and put it into a separate view, then view C does not disappear when the published property is updated.

  6. The code I remove from view A uses another view which has a @ViewBuilder property. Removing the @ViewBuilder property also prevents the crash.

Again, there is no crash report or anything. I don't have the time to produce non-NDA code for demonstration purposes, but has someone ever seen something like this?

Best, Philip

View crashes/disappears if root of NavigationViews links to view with @ViewBuilder property?
 
 
Q