简体   繁体   中英

How to show split view controller on tab bar from different storyboard?

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

下面是我的Main.storyboard,它有标签栏控制器。我希望在其中一个选项卡中显示拆分视图控制器。 splitVC在其他故事板中,如第二张图所示

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?

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,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM