I want to display a detail view pushed via NavigationLink that fully covers the TabView's tab bar, yet still allows the native left-edge swipe-to-pop gesture. I considered FullScreenCover and hiding the tab bar, but neither solution meets my needs. The idea is to have an interactive detail view that, when partially swiped, reveals the tab bar beside it (like the half-swiped dialogs seen in Telegram or WhatsApp).
I also need each tab to maintain its own NavigationView for unique titles and instance-specific navigation stacks, so wrapping the TabView in a single NavigationView is not an option.
Here is my current code:
struct MainTabView: View {
var body: some View {
TabView {
NavigationView {
List {
NavigationLink("First Detail", destination: DetailView(title: "First Detail"))
NavigationLink("Second Detail", destination: DetailView(title: "Second Detail"))
NavigationLink("Third Detail", destination: DetailView(title: "Third Detail"))
} .navigationTitle("Home")
} .tabItem { Label("Home", systemImage: "house") }
Text("Second Tab") .tabItem { Label("Settings", systemImage: "gear") }
}
}
}
struct DetailView: View {
let title: String
var body: some View {
ZStack {
Color.gray.ignoresSafeArea()
Text(title).font(.largeTitle)
}
.navigationTitle(title)
}
}
Is it possible to achieve this behavior purely with SwiftUI?