Assuming we have a SwiftUI view containing
struct ContentView: View {
var body: some View {
TabView {
FirstView().tabItem {
// tabItem image and text
}
SecondView().tabItem {
// tabItem image and text
}
}
}
}
Now, let's say FirstView
contains a NavigationView
with scrollable content using NavigationLink
for each element. How can I make it such that when a NavigationLink
destination is triggered (i.e. a child view is opened), that it takes over the whole page (in full-screen) and thus hides the TabView
?
Ideally I would like to support iOS 13+.
I have tried to follow the guidance at Hacking with Swift but to no avail.
I also followed the advice in SwiftUI Hide TabView bar inside NavigationLink views but found that the top solution is not so performant, so I am hoping to achieve a solution without a delayed appearance.