I have a master list -> detail view UI. Looks fine.
But when I show a detail view of one of the list element, the view sometimes supriously goes back to the list.
The master list can be updated in the background and when this happen, the list is re-ordered. I think that what is causing the "going back". According to this SO question SwiftUI Navigation View goes back in hierarchy and to this WWDC video, it seems my views identity are not constant.
How can I read and debug the view hierarchy (I mean SwiftUI view, not the corresponding UIViews) and their identity ?
Edit: changed the title to be more in line with the question.
You can use:
var body: some View {
#if DEBUG
let _ = Self._printChanges()
#endif
in your body definition to find out why this view is redrawn.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With