odysee-ios
odysee-ios copied to clipboard
[Chore] Tab bar controller should fill screen, prevent hitches & jumps when navigating
Right now, the VC hierarchy is like this:
- MainViewController with top bar
- Nav Controller
- Tab Bar Controller
- Home View Controller
- etc.
- Tab Bar Controller
- Nav Controller
The problem with this setup is that when you push or pop that navigation controller, the top bar doesn't go away because the top bar is outside of the nav controller, so it jerks around and we have to manually play with it.
Also, because the tab bar controller is inside of the nav controller, you lose your tab bar whenever you push into a screen. We want to keep that tab bar there.
A better setup would be:
- Tab Bar Controller
- Nav controller 1
- Home view controller
- Nav controller 2
- Following view controller
- Nav controller 1
Whenever the user switches tabs, we move the top bar to the root view controller of tab they're on.
This will make everything easier and smoother going forward, and it'll open the door for a "slide-away" top bar implementation.
How would we handle cases for screens that do not have corresponding tabs?
If you push a view controller that wants to hide the tab bar, set hidesBottomBarWhenPushed
on that view controller.
Here's a sample app that shows what I mean: TabDemo.zip
The difference is here:
As a user, I think this is high priority. I would say that the jankiness of the tab bar animations on pushes and pops is very broken, and it honestly takes the "quality feeling" of an otherwise great app way way down and makes it look pretty amateur.
Hopefully it's a relatively straightforward fix. Nice suggestions @Adlai-Holler