简体   繁体   English

如何将单独的故事板链接到uitabbarcontroller中的每个特定选项卡?

[英]How to link a separate storyboard to each particular tab in uitabbarcontroller?

I have an app which has 5 major user flows..each flow is a few screens linking to each other...so each flow warranties its own storyboard. 我有一个具有5个主要用户流的应用程序。每个流是互相链接的几个屏幕...因此,每个流都保证有自己的情节提要。 Each storyboard starts with a custom view controller that is embedded in a navigation controller. 每个情节提要板都以嵌入在导航控制器中的自定义视图控制器开始。 So far so good. 到现在为止还挺好。

Now all of this is "stitched" together via a UITabBarController. 现在,所有这些都通过UITabBarController“缝合”在一起。 This is the most default UI design ever known to iOS. 这是iOS已知的最默认的UI设计。

But turns out I don't really know how to link from tabbarcontroller, which is in its own storyboard (that is set as the main one on code project) to any of the other storyboards. 但是事实证明,我真的不知道如何从tabbarcontroller(位于其自己的故事板(在代码项目中设置为主要项目))链接到其他任何故事板。

This problem looks so! 这个问题看起来是这样! simple, so I think I am missing something utterly obvious, but I just can't figure out how to do it. 很简单,所以我认为我确实缺少一些显而易见的东西,但我只是不知道该怎么做。

So how do I link from tab bar controller in storyboard 1 to the initial view controller in storyboard 2 when a tab is tapped? 那么,如何在单击标签时从情节提要1中的选项卡栏控制器链接到情节提要2中的初始视图控制器?

You should do this in code. 您应该在代码中执行此操作。 You can have the tab bar controller (tbc for short) and the controller in the first tab in the app's main storyboard, and in the app delegate, instantiate the other controllers using instantiateInitialViewController . 您可以将标签栏控制器(简称tbc)和控制器放在应用程序主故事板的第一个标签中,然后在应用程序委托中,使用instantiateInitialViewController化其他控制器。 Create a mutable array by copying the tbc's viewController array, add the other controllers you instantiated to it, and then set that array as the tbc's viewControllers array. 通过复制tbc的viewController数组创建可变的数组,将实例化的其他控制器添加到该数组,然后将该数组设置为tbc的viewControllers数组。

您必须在标签栏中以编程方式添加ViewController。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UITabBarController-如何切换到特定类型的选项卡 - UITabBarController - How to switch to tab of a particular type 如何使用 StoryBoard 在 UITabBarController 中设置选定的选项卡? - How do I set selected tab in UITabBarController using StoryBoard? UITabBarController故事板启动屏幕 - 初始标签? - UITabBarController storyboard launch screen - initial tab? 将UITabBarController的新选项卡添加到另一个情节提要 - Add a new tab for a UITabBarController to another storyboard 为 UITabBarController 中的每个选项卡添加一个 webview? - Adding a webview for each tab in UITabBarController? 故事板 - UITabBarController - Storyboard - UITabBarController Xcode故事板选项卡式应用程序(UITabBarController)-告知何时选择选项卡 - Xcode Storyboard Tabbed application (UITabBarController) - tell when tab selected 故事板-如何在UINavigationController中使用UITabbarController自定义UITabbarItem - Storyboard - How to custom UITabbarItem with UITabbarController inside UINavigationController 如何以编程方式添加UITabBarController(无xib文件或故事板) - How to add UITabBarController programmatically (no xib file or storyboard) 如何从 Storyboard 将 UITabBarController 设置为 rootViewController - How to set a UITabBarController as rootViewController from Storyboard
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM