Disable new tab bar look

Hi, I am trying out the new UITabBar stuff in iOS18, and I don't think it'll be a good fit for my app. Is there a way to revert to the old iPad UITabBar look and placement that we've been using before? I don't want to make such a big change like this just yet, but I would need to make other changes to the app as well and I don't want to use the new UITabBar just yet. Is there a way to achieve this?

Answered by DTS Engineer in 790193022

There's a new API in UITabBarController to hide the tabBar under isTabBarHidden

That's not possible as of now.

I have filed a feedback for this:

FB13840897

In my app I did adopt UISplitViewController to show a sidebar when the window is large enough or a tab bar in compact size classes. For that to work I had to do custom code to restore view hierarchies when switching size classes. Now, UITabBarController has this behavior for free, but I don’t want to adopt the new top tab bar in my app, because it breaks my layout and I just don’t like the look and feel of it. It would be great to have an option to hide the top tab bar, while keeping the sidebar visible and show the bottom tab bar when switching to compact size class.

+1 for having the ability to disable the new tab bar floating, it will give us the opportunity to adopt it overtime (in case of huge issues) as well as if it doesn't make sense for app in its current state.

There's a new API in UITabBarController to hide the tabBar under isTabBarHidden

@DTS Engineer your suggestion hides the tabbar, what I think the author would like is to make it opt in (or out) to get the old tabbar back

I have taken the time to write a blog post about all the issues I see with this new tab/sidebar design. If you're interested feel free to take a look and file similar feedback so we can have a better system in the Fall!

https://gamery.app/blog/about-the-new-tabs/

@ps3zocker thanks for the detailed overview of the problem. I filed my own feedback (FB13902858) and referenced your blog post and feedback ids. Let's hope Apple gives us the option to opt-out of the new tab view behavior in iPadOS 18.

Please add an API to allow reverting to the old tab bar, do not punish developers who like to adopt native UI controls. For some Apps, there will be huge changes needed to satisfy this new Tabbar on iPad, to an extend that it is much easier to just rewrite a TabBar.

100% agree there needs to be a way to disable this. Having it be automatic with no way to disable it can break more complex UIs and operates under the assumption that it is a better approach, which it may not be for a given app.

It also has some unwanted effects with Catalyst apps, such as forcing a title bar/toolbar at the top of the window containing the tabs from the tab view, even if the app wants to hide the titlebar. Again, I think it is an erroneous assumption that every app should want this and there needs to be an opt out.

The accepted solution does not accomplish this. I'm not sure why it was marked as such.

Has anyone checked out if there's something in iOS18 Beta4 that can help out with this issue?

FWIW, I recently got a response through Feedback assistant saying that the new UITabBarController behavior is "functioning as intended" and suggests that the best option would be to hide the UITabBarController and create a custom control to get the old functionality again.

I personally find it very unreasonable to change the behavior of something that's been working fine for 17 years and replace it with something that's a confusing ill-thought-out mess, and not offer an opt-in / opt-out. But there you go. At least we have a few weeks to come up with alternatives.

This is frankly half-baked and should not be released to the public in its current state. The lack of clear communication has been frustrating

100% agree the current implementation seems half-baked, and that's being generous. It also doesn't fit with some designs so to effectively remove existing behavior in favor for one that isn't workable seems silly.

It also breaks some behavior in Catalyst, even though it should not change anything on that side. Not having an opt-out is extremely frustrating and the Feedback system has shown itself to be woefully inadequate in getting things fixed.

At the very least an opt-out option allows developers time to figure out how to rework their apps to integrate it properly while still being able to take advantage of other features in iPadOS 18. This is just yet another thing that has me losing faith in Apple and makes me question on whether its a worthwhile platform for future projects.

I'm using UIKit, and currently this is my workaround to make the tab bar to revert it back to the old look (displayed at the bottom).

class CustomTabBarController: UITabBarController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        guard #available(iOS 18, *), UIApplication.shared.isPad else {
            return
        }
        
        traitOverrides.horizontalSizeClass = .compact
    }
}

class CustomTabBarChildNavigationController: UINavigationController {
    override func viewWillLayoutSubviews() {
        super.viewWillLayoutSubviews()
        
        adjustSizeClass()
    }
}

class CustomTabBarChildViewController: UIViewController {
    override func viewWillLayoutSubviews() {
        super.viewWillLayoutSubviews()
        
        adjustSizeClass()
    }
}

extension UIViewController {
    var rootViewControllerHorizontalSizeClass: UIUserInterfaceSizeClass {
        guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
              let keyWindow = windowScene.windows.first(where: { $0.isKeyWindow }),
              let rootViewController = keyWindow.rootViewController else {
            return .regular
        }
        
        return rootViewController.traitCollection.horizontalSizeClass
    }

    func adjustSizeClass() {
        guard #available(iOS 18, *), UIApplication.shared.isPad else {
            return
        }
        
        // The child view controllers of the tab bar should follow the horizontal size class of the
        // root view controller else it will have the side effect, e.g. the child view controller
        // will show the content using compact horizontal size class.
        traitOverrides.horizontalSizeClass = rootViewControllerHorizontalSizeClass
    }
}

Now, change your existing subclasses to inherit the new class:

  • UITabBarController -> CustomTabBarController
  • UINavigationController -> CustomTabBarChildNavigationController
  • UIViewController -> CustomTabBarChildViewController

It works fine for my app so far. This workaround also covers the scenarios of split view and multitasking.

If you find any issue with this approach, please share it here.

@kienw notice how the tab bar usually displays the tab bar item image + title horizontally in a regular size class, but vertically when compact and it might be nice to adjust this too. This lead me to adjusting it all within the custom tab bar controller

class CustomTabBarController: UITabBarController {
    override func viewDidLoad() {
        super.viewDidLoad()
        if #available(iOS 18.0, *), UIDevice.current.userInterfaceIdiom == .pad {
            traitOverrides.horizontalSizeClass = .compact
        }
    }

    override func viewWillLayoutSubviews() {
        super.viewWillLayoutSubviews()
        if #available(iOS 18.0, *), UIDevice.current.userInterfaceIdiom == .pad {
            tabBar.traitOverrides.horizontalSizeClass = rootViewControllerHorizontalSizeClass
            viewControllers?.forEach { viewController in
                viewController.adjustSizeClass()
            }
        }
    }
}

From my brief testing this has been fine and might be a backup solution while figuring out how to work with the new design.


Another option if the trait overrides feels too much like a hack. might be to do a custom tab bar controller and using a UITabBar directly. Alternatively hiding the default one as @DTS Engineer says and adding your own to manage.

Did someone find a way to go back to the old tab bar version? All the hacks rewriting the sizeClass and having to bring it back accessing the UIApplication.shared scenes are very hacky and are not a solid solution. Did someone read something else from Apple side? There is a new "mode" property in UITabBarController, but it does work, does not roll back to the old tab bar version.

Disable new tab bar look
 
 
Q