1

In my app I'd like to have only one storyboard for both iPad and iPhone. My root controller is a UITabBarController with 7 children, most are UISplitViewController.

On the iPhone the More tab appears automatically to get access to all tabs, making them pushed from there, thus resulting in an error:

Split View Controllers cannot be pushed to a Navigation Controller

How can I solve this problem?

Thanks a lot!

lorenzo
  • 1,487
  • 1
  • 17
  • 25
  • Take a look at this: http://stackoverflow.com/questions/10021210/ios-uisplitviewcontroller-cannot-be-pushed-to-uinavigationcontroller May be this can solve your problem. – Dharmesh Siddhpura Sep 29 '15 at 10:44

1 Answers1

0

Ok, in a nutshell, what I finally went for is to create my UISplitViewControllers programatically when the user's device is an iPad while keeping most of my storyboard the same.

to do that:

  • In IB, I removed all the viewcontrollers from my UITabBarController (the links)
  • I gave each of these UIViewControllers a Storyboard ID
  • In the didFinishLaunchingWithOptions of the AppDelegate, I created a method to build the hierarchy of my views, using the storyboard ID to instantiate the ViewControllers, and adding a UISplitViewController when being on an iPad. All of this is done in association with a datasource object that fine tunes the needs of each of my screens.

Hope that helps!

lorenzo
  • 1,487
  • 1
  • 17
  • 25