UISplitViewController and UITabBarController in iOS 15 is always full screen

I'm reworking my app and update code and design. Because my app is one both iPhone and iPad, i'm using Splitview to handle the configurations. But my app has 4 section that I manage using a Tab bar and each tab has a SplitView.

As you can see in images, the problem is that if I attach directly the UISplitViewController to UITabBarController you don't see two columns but only one (the primary or secondary view) both iPhone landscape orientation and iPad.

A solution that I found is to attach the splitviewcontroller to a view that contains a ContainerViewController e connect the split view to this container. If you do this, you see the split view work correctly ma the problem is the customization of appearance (look at image 3) So may questions are:

  1. why I have to embed a split view in a container view controller and i can't connect it directly to tabbar as we done until now?
  2. Is there an other better solution then put a split view in a containerView?

Thank you

)

Replies

I've also been running into this issue when building my app with Xcode 13.3. One workaround I have found to work is setting the UISplitViewController's style to ‘Unspecified (Discouraged)’. Alternatively the issue does not seem to appear when using Xcode 13.2.

I have submitted a feedback with a minimal reproducible project #FB9959996

  • Was there any progress to the ticket? I can't access it. I'm facing the same problem.

Add a Comment

For posterity, the issue still exists in iOS 17, and it’s by Apple’s assumption that a split view controller is always a window’s root view controller. You can workaround this by overriding the trait collection of the split view controller when the parent tab bar controller’s collection changes:

override func willTransition(to newCollection: UITraitCollection, with coordinator: any UIViewControllerTransitionCoordinator) {
	super.willTransition(to: newCollection, with: coordinator)
	
	coordinator.animate { _ in
		if let split = viewControllers?.first as? SplitViewController {
			setOverrideTraitCollection(newCollection, forChild: split)
		}
	}
}