SwiftUI: Dismiss View Within macOS NavigationView
问题 As detailed here (on an iOS topic), the following code can be used to make a SwiftUI View dismiss itself: @Environment(\.presentationMode) var presentationMode // ... presentationMode.wrappedValue.dismiss() However, this approach doesn't work for a native (not Catalyst) macOS NavigationView setup (such as the below), where the selected view is displayed alongside the List . Ideally, when any of these sub-views use the above, the list would go back to having nothing selected (like when it