UIKit Container View Controllers and iPhone Duo

Hi, I have an app based almost entirely on standard system components and UICollectionViewController that I'd like to adapt for the iPhone Duo I'd like to describe my viewController setup and ask a few questions, please correct me if any of the statements are incorrect. In the time between the annoucement of the Duo and the release of Xcode 27.1 I also tried to adapt the app to the iPad. It's a simple set up so I think it should be make a good example for questions.

My rootViewController is a UITabBarController so on the iPad I get the sidebar (but not the iPhone Duo)

Up until now, on the iPhone (horizontal compact) I normally pass a UINavigationController to the UITab's viewController provider closure. This works well because on the iPad when the sidebar is hidden the tab bar at the top of the screen floats above the visible tab's navigation bar

For the iPhone Duo and iPad I need a container view controller to load two viewControllers into the rootViewController to make use of the extra horizontal space.

Presumably I sholud setup and keep the same view hierarchy (for all devices) and adapt it based on changes to the traitCollection.horizontalSizeClass

Using a split view controller's supplementary/second column seems to work well, the UITabBarController manages the sidebar on iPad, views can be resized by the user.Tthe supplementary column is hidden automatically in horizontalSizeClass compact. The navigation bar of the supplementary/second column stays below the floating tab bar -which is understandable because of the split. If I hide the navigationBar on the supplementary/second columns, Is it possible to instal bar items in a navigation bar at the top of the screen/below the floating tab bar?

Also if i hide the supplementary column when the iPhone Duo is unfolded, the empty navigation bar becomes visible at the top of the screen, I think this might be a bug.

I also tried UIArrangementView. I'm sure if it's suited for this use case as primary (leading) placement needs to switch to the secondary (trailing) placement when the iPhone Duo is unfolded. Is there something that I didn't understand correctly?

Hello @neillino, thank you for your question!

I am having some trouble following what you are illustrating in your post. How is this supplementary column being used? Could you please provide some screenshots?

What is in your primary column in the UISplitViewController?

From what you are describing, a UIArrangementViewController is not the control you are looking for. We do not recommend embedding a UINavigationController in a `UIArrangementViewController.

Hi, I don't set a primary column on the UISplitViewController, it's managed by the UITabControllerSidebar., the supplementary column provides some insights about user activity (insights). Here's the setup code

 let splitViewController = UISplitViewController(style: .tripleColumn)
   				 // Note. shows supplementary + secondary, hides primary
                splitViewController.preferredDisplayMode = .automatic 
  let insightColumnVC = InsightColumnController(traitCollection: splitViewController.traitCollection)
                 
                 splitViewController.setViewController(insightColumnVC, for: .supplementary)
                 splitViewController.preferredSupplementaryColumnWidth = 50.0
                 splitViewController.displayModeButtonVisibility = .automatic

  			let listColumnVC = ListController(traitCollection: splitViewController.traitCollection)
   
                 // Note: splitViewController will wrap it in a UINavigationController
                 splitViewController.setViewController(listColumnVC, for: .secondary)
                 return splitViewController
}

Ps. I can share screenshots confidentially, no problem.

One thing to consider for UITabBarController to enable the sidebar on iPhone Duo is to adopt the new sidebar placement API from iOS 27.

tabBarController.sidebar.preferredPlacement = .sidebar

When set, then the sidebar will be displayed when it is in a supported environment (i.e. regular horizontal size class).

UIKit Container View Controllers and iPhone Duo
 
 
Q