Tab level navigation stacks and still push navigation on top of TabBar #52
-
Hi David, I have a following issue. Do you know how to solve this using SwiftUI (either directly using SwiftUI or via your library) Basically I have a SwiftUI app with 5 tabs. I want all 5 tabs to have their own navigation stack but when I push from any of them I want to present on top of my TabBar. Currently I am using .toobar(hidden, .tabBar) API but it doesn't look good as it does not give the same effect of pushing over the TabBar and when we slide back the TabBar just shows back after showing hidden for some time. I also dont want to put my TabView inside Global NavigationStack because it has other problems of keeping too much code in single place to manage all the navigation bar titles and buttons and is error prone. Is there a way to keep separate NavigationStack for each tab and still push to navigation stack as if the NavigationStack was sliding on top of TabBar? The example of this is in Facebook messenger apps "People" tab when pushes it keeps showing TabView however the "Settings" tab pushes over the TabBar. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is a very good question, albeit somewhat unrelated to this library. I've been chasing this exact behavior myself for some time now. Just like you, I thought the newly introduced One thing I've tried is using SwiftUI-Introspect to set the destination view controller's As far as I know, the only thing we can do is file a radar for Apple to fix the One final thought would be to roll out your own custom tab view for this, but personally I don't think there's a clear benefit to this. The maintenance cost just seems too high, but obviously YMMV. Perhaps there's a chance for a middle-ground solution consisting of a view that leverages the existing |
Beta Was this translation helpful? Give feedback.
This is a very good question, albeit somewhat unrelated to this library.
I've been chasing this exact behavior myself for some time now. Just like you, I thought the newly introduced
.toolbar(.hidden, .tabBar)
API would do the trick, however as you rightly mention the effect is quite glitchy.One thing I've tried is using SwiftUI-Introspect to set the destination view controller's
hidesBottomBarWhenPushed
totrue
, however that doesn't seem to have any effect, which is really a shame.As far as I know, the only thing we can do is file a radar for Apple to fix the
.toolbar(.hidden, .tabBar)
modifier to act more likehidesBottomBarWhenPushed
.One final thought would be to roll out your own c…