我正在寻找在UITabBar级别拆分Storyboard的解决方案。 我有一个带有5个标签的应用程序,我想用不同的故事板管理每个标签。 该结构将是一个简单的最小故事板,带有标签栏控制器和5个更大的故事板,每个标签视图控制器(和segues)必须继承标签栏。 是不是每个人都像这样拆分故事板?任何线索? 感谢
答案 0 :(得分:3)
我认为这可能会出现在你的自定义UITabBarController
的“viewDidLoad”中......
NSMutableArray *controllersArray = [[NSMutableArray alloc] init];
// Load the initial UIViewController from every Storyboard
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Storyboard1" bundle:nil];
UIViewController *first = [sb instantiateViewControllerWithIdentifier:@"firstViewController"];
[controllersArray addObject:first];
// Repeat the process with the rest
...
// Set your controllers
self.viewControllers = [controllersArray copy];
请记住为每个主UIViewController
设置一个Storyboard ID,例如'firstViewController'。
答案 1 :(得分:1)
我们使用了来自http://robsprogramknowledge.blogspot.co.il/search/label/UIStoryboard的RBStoryboardLink 解决这个问题