I have a macOS Master/Detail app that uses a NavigationView with a sidebar menu in the left panel and a range of detail views in the right panel.
I want to retain the detail views when a user selected a different sidebar menu option such that if the user switches back by selecting a previously selection menu option then the app should display the originally created detail view with any user changes or selections.
Currently it seems that SwiftUI creates a new view from scratch when a menu option is selected rather than just displaying the previously created one. For example if the detail view has a ListView and the user previously selected an item then this selection gets lost as does any previous scroll position.
Is there anyway to achieve this with SwiftUI.