I'm experiencing an issue with hiding the tab bar in a SwiftUI TabView after updating both my simulator and physical device to iOS 17.4.
TabView(selection: $tabSelection) {
Group {
View1()
.tag(0)
View2()
.tag(1)
}
.toolbar(.hidden, for: .tabBar)
}
View1 is the default view and contains a scroll view. Initially, upon launching the app, everything works as expected, and the tab bar is correctly hidden. The problem arises when I switch to View2 (where the tab bar remains hidden as it should), but then upon returning to View1, the tab bar becomes visible again.
Does anyone have any ideas how to fix this behaviour?
I checked on previous iOS versions and it seems this only occurs on iOS 17.4.
I am not sure what behavior you are looking for but you might want to put the modifier on the view. Not sure if this helps. You can place the NavigationStack and NavigationLink on this view to help navigation.