Master-Detail App - Detail View First

Hi,


I'm trying to make a simple Master-Detail SwiftUI app, like the one you can choose when you create a new project in Xcode, with the only exception that the first row in the table/List is pushed initially (at first app load). I.e. when the app starts I want the detail view for the first row to be shown. Then, when you navigate back, you will see the table/List. How can this be done? (iPhone, not iPad with split view.)


I have tried setting the isActive argument of NavigationLink to true for the first row only, and this looks like it has the wanted effect. However, when you navigate back, from the detail view of the first row (after having set isActive to false again), it is not possible to push the first row again (bug?).

Any idea of how this can be done?

Kind regards,

Anders Sejersbøl.

Accepted Reply

When you reslect the same line than previously selected, the link does not fire, hence the view does not appear.


If you select second and then select first, it will show.


You should have to clear the selection when you navigate back.


Have a look here:

https://stackoverflow.com/ questions/59061298/cant-select-same-row-twice-in-swiftui

Replies

When you reslect the same line than previously selected, the link does not fire, hence the view does not appear.


If you select second and then select first, it will show.


You should have to clear the selection when you navigate back.


Have a look here:

https://stackoverflow.com/ questions/59061298/cant-select-same-row-twice-in-swiftui

Yeah, if I take a standard Master-Detail app from Xcode, and change nothing(!), the problem is still there. Navigation forth, back and forth on the same row gives the same problem as I'm seeing (row will not push / locks up). So, I can only confirm that this bug is not fixed in iOS 13.3.


I hope this will be fixed soon. Thanks!