Vertical tab bar doesn't appear when tab bar controller is added to view controller while iPhone Duo is unfolded

Hi, I would like to share an issue with UITabBarController's vertical tab bar and iPhone Duo's unfolded pose.

On iPhone Duo (27.2 beta 3), when tab bar controller is added to the view controller while in unfolded pose, the vertical tab bar doesn't appear unless the tab bar controller view's frame is set manually before adding it to the parent's view.

  1. Show any VC. Use unfolded Duo pose.
  2. After some time/on button press add a UITabBarController to it: (https://developer.apple.com/documentation/uikit/creating-a-custom-container-view-controller#Add-a-child-view-controller-programmatically-to-your-content) with Auto Layout constraints.
  3. Vertical tab bar does not appear.
  4. Fold and unfold the device. The tab bar appears.

Expected: Tab bar appears after adding the UITabBarController in unfolded Duo pose.

Actual: Tab bar does not appear after adding the UITabBarController in unfolded Duo pose.

In Feedback Assistant report (FB25261013) I attached minimal reproduction example and recordings showing the different behavior in folded and unfolded poses and behavior with manual frame application fix (commented out in minimal reproduction example).

Minimal reproduction example:

// SceneDelegate.swift
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
        window = UIWindow(windowScene: windowScene)
        window?.rootViewController = ViewController()
        window?.makeKeyAndVisible()
    }
}

// ViewController.swift
import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .systemBackground

        let button = UIButton(configuration: .filled(), primaryAction: UIAction(title: "Show Tab Bar Controller") { [weak self] _ in
            self?.showTabBarController()
        })
        button.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(button)
        NSLayoutConstraint.activate([
            button.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            button.centerYAnchor.constraint(equalTo: view.centerYAnchor),
        ])
    }

    private func showTabBarController() {
        let tabBarController = UITabBarController()
        tabBarController.tabs = ["First", "Second", "Third"].map { title in
            UITab(title: title, image: UIImage(systemName: "circle"), identifier: title) { _ in
                let viewController = UIViewController()
                viewController.view.backgroundColor = .systemBackground
                return viewController
            }
        }

        addChild(tabBarController)
        
        // Uncomment to show the tab bar on the unfolded iPhone Duo.
         tabBarController.view.frame = view.bounds
        
        view.addSubview(tabBarController.view)
        tabBarController.view.translatesAutoresizingMaskIntoConstraints = false
        NSLayoutConstraint.activate([
            tabBarController.view.topAnchor.constraint(equalTo: view.topAnchor),
            tabBarController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
            tabBarController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
            tabBarController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
        ])
        tabBarController.didMove(toParent: self)
    }

}

Thank you in advance.

Thanks for the post, I just tried the code using Xcode 27.2 Release Candidate and I do not see the behavior you have described when I open the simulator the view folded and unfolded shows the tabBarController, please let me know if you have the chance to use the RC version of Xcode 27.2. As you said you are using 27.2 beta 3.

Thanks

Albert  WWDR

I reproduce the bug in a small test project. The reproduction is attached to the Feedback Assistant Report FB25261013 (in that thread I added a fixed minimal reproduction example with the workaround line commented out). I also uploaded the reproduction to GitHub, please see here.

Thank you for your help.

@kligarski Thanks for the post, and thanks for filing a bug, so you didn't try the Xcode 27.2 RC? Either way.

You can see the status of your feedback in
Feedback Assistant.
There, you can track if the report is still being investigated,
has a potential identified fix, or has been resolved in another way.
The status appears beside the label "Resolution."
We're unable to share any updates on specific reports on the forums.

For more details on when you'll see updates to your report, please see
What to expect after submission.

Albert  WWDR

I did reproduce the issue using Xcode 27.2 RC.

In the first minimal reproduction example by mistake I left out a workaround in the code (setting the frame manually). When I removed the workaround, the bug still reproduces on Xcode 27.2 RC (the reproduction uploaded to GitHub is the updated one - it reproduces with Xcode 27.2 RC).

I hope that clears everything up.

Thanks.

@kligarski Clears everything, thanks so much for the reply and clariffication.

Albert  WWDR