UITabBarController is unsupported as viewController

Hi,

I'm testing one of my app on iOS 14 with Xcode 12 beta 3 (12A8169g) and I have a problem with my storyboards.

Xcode give me this error for all the storyboards that contain a split view controller:
An internal error occurred. Editing functionality may be limited.

The log generated by the Xcode "Report a bug" button say:
Exception name: NSInvalidArgumentException
Exception reason: UITabBarController is unsupported as viewController for -[UISplitViewController setViewController:forColumn:] in Primary column


It worked correctly on Xcode 12 beta 2.

Has anyone encountered the same problem and found a way to fix it?

Thank you

Replies

I just ran into this as well with Xcode 12 beta 4. As in your case it worked in the earlier betas (not sure if I tested beta 3). In our case the exception happens on runtime, so I cannot start the app. Do you only have the issue for editing the storyboard?
Hi,

For the moment I edit my storyboards with Xcode 11.
On runtime I have no problems because I programmatically changed the style of my split view controllers to classic (the behaviour before iOS 14). In this way you can still embed split view controllers inside tab bar controllers as you always did.

Ideally we should be able to set the classic behaviour directly from storyboard. Fortunately I see in the release notes of Xcode 12 beta 4 that apple has reported this point as "Known Issues" and therefore I expect that it will be solved in one of the next beta.

From Xcode 12 beta 4 release notes:
"Interface Builder doesn’t allow creating a classic style UISplitViewController. (65966010) (FB8107534)"
Hmm I'm not sure then if we have the same issue after all. For me I don't have issues when opening/editing the storyboard with Xcode 12. But we're actually embedding a UITabBarController inside a UISplitViewController as the primary vc.
In my case I have a split view controller inside a tab bar controller. But for the crash you have at runtime you can try to set the style of your split view controller to classic. I think this should solve the problem.
I have a Tab bar Controller with 4 view controllers and have also had this issue " UITabBarController is unsupported as viewController for -[UISplitViewController setViewController:forColumn:] in Primary column" since Updating to Xcode 12.... I've tried to change the behaviour back to Classic... but not sure how I do this? or is there a better way to solve this? :)

Thanks
I just ran into this too. The way I was able to get around it was to edit the SplitViewController in the storyboard and set the Style to 'Unspecified'. I think this is the 'classic' mode for SplitViewControllers, as opposed to the 2-column vs 3-column styles that Apple is now encouraging.
I think maybe the "Build For iPad" WWDC video explains the roadmap for where SplitViewControllers are going. We will all eventually have to rethink how our UI's work.

A workaround is to use a blank UIViewController as the viewController for the UISplitViewController instead and add the UITabBarController as a child viewController to the blank viewController. This also works with all types of UISplitViewControllerStyle.