odysee-ios icon indicating copy to clipboard operation
odysee-ios copied to clipboard

[Chore] Tab bar controller should fill screen, prevent hitches & jumps when navigating

Open Adlai-Holler opened this issue 3 years ago • 3 comments

Right now, the VC hierarchy is like this:

  • MainViewController with top bar
    • Nav Controller
      • Tab Bar Controller
        • Home View Controller
        • etc.

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

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.

Adlai-Holler avatar Jun 08 '21 11:06 Adlai-Holler

How would we handle cases for screens that do not have corresponding tabs?

akinwale avatar Jun 23 '21 15:06 akinwale

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: Screen Shot 2021-06-23 at 12 45 08 PM

Adlai-Holler avatar Jun 23 '21 16:06 Adlai-Holler

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

tsheaff avatar Sep 24 '21 11:09 tsheaff