3

The below is my Main.storyboard and it is having tab bar controller. I wish to show a split view controller in one of the tabs of it. The splitVC is in other storyboard as shown in second picture

The below is my Main.storyboard and it is having tab bar controller. I wish to show a split view controller in one of the tabs of it. The splitVC is in other storyboard as shown in second picture

This is second storyboard which has a split view controller.

This is second storyboard which has a split view controller.

I am unable to show it in main storyboard using following approaches: • Using container view: I tried to show the splitVC in container view programatically but it is throwing error saying :ContainerView must have view controller at index 1 (I tried container view as shown in first picture.)

Can anyone suggest the best way to show it on tab bar ? Or if I am doing container approach not correctly?

djay
  • 375
  • 2
  • 18

1 Answers1

2

Hi @Divjyot Answers here might help apple recommends UISplitViewController should always be the rootviewcontroller

Here is the note from apple

You cannot push a split view controller onto a navigation stack. Although it is possible to install a split view controller as a child in some other container view controllers, doing is not recommended in most cases. Split view controllers are normally installed at the root of your app’s window. For tips and guidance about ways to implement your interface,

Community
  • 1
  • 1
Koushik
  • 1,220
  • 15
  • 19
  • Hi, Thanks! I concur that! Can you suggest _how to install a splitVC as child in some other container view controller_ also ? – djay Jul 19 '16 at 07:40
  • Sorry Dude I tried that for nearly 1 week and I didnt get any positive response. I tried using it in uinavigationcontroller still I will try once again using tabviewcontroller and update you – Koushik Jul 19 '16 at 07:43
  • Using navigation I can launch it nicely just on tap of a button in Main.Storyboard's VC thus presenting the SplitVC using second storyboard ID and SplitVC's ID. But In tab bar approach, I used to do like putting container view in a VC (in Main.stry) and showing another's VC inside it from other storyboard. But since the SplitVC is different maybe its not working that way... Sure update if anything comes up! – djay Jul 19 '16 at 07:49