How to pop multiple views off a navigation stack?
问题 Looking for some guidance on a simple way to pop multiple views off a navigation stack in SwiftUI. I have 4 views chained together using NavigationLink. At the last view I would like to jump back to the initial ContentView, popping all the other views off the stack. I don't want to use the "Back" button on the NavigationBar of each view to achieve this. Thanks in advance. Bob. ''' import SwiftUI struct ContentView: View { var body: some View { NavigationView { VStack { NavigationLink