I'm trying to find a way for the tabBar to become hidden upon the appearance of SecondView(). Every attempted solution I've seen so far hasn't worked (or I've implemented it incorrectly). Is there a straightforward way to implement this?
Code:
struct MainView: View {
var body: some View {
TabView {
FirstView()
.tabItem {
Image(systemName: "house.fill")
}
}
}
}
struct FirstView: View {
var body: some View {
NavigationView {
NavigationLink(
destination: SecondView(),
label: {
Text("Second")
}
)
}
}
}
struct SecondView: View {
var body: some View {
Text("Second")
}
}