SwiftUI Present View Modally via TabView?
问题 I have a TabView set up as follows: struct ContentView: View { @State private var selection = 0 @State var newListingPresented = false var body: some View { TabView(selection: $selection){ // Browse BrowseView() .tabItem { VStack { Image(systemName: (selection == 0 ? "square.grid.2x2.fill" : "square.grid.2x2")) } } .tag(0) // New Listing NewListingView() .tabItem { VStack { Image(systemName: (selection == 1 ? "plus.square.fill" : "plus.square")) } } .tag(1) // Bag BagView() .tabItem { VStack