转到另一个故事板? [英] Segue to another storyboard?

查看:26
本文介绍了转到另一个故事板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从一个情节提要到另一个情节提要,或者将情节提要嵌入另一个情节提要的视图控制器中?我需要在 UINavigationController 中放置一个 UITabBarController,并且我想让它们保持良好和独立.

Is it possible to segue from one storyboard to another, or to embed a storyboard in a view controller in another storyboard? I need to place a UITabBarController in a UINavigationController, and I'd like to keep them nice and separate.

推荐答案

可以,但必须以编程方式进行:

Yes, but you have to do it programmatically:

// Get the storyboard named secondStoryBoard from the main bundle:
UIStoryboard *secondStoryBoard = [UIStoryboard storyboardWithName:@"secondStoryBoard" bundle:nil];

// Load the initial view controller from the storyboard.
// Set this by selecting 'Is Initial View Controller' on the appropriate view controller in the storyboard.
UIViewController *theInitialViewController = [secondStoryBoard instantiateInitialViewController];
//
// **OR**  
//
// Load the view controller with the identifier string myTabBar
// Change UIViewController to the appropriate class
UIViewController *theTabBar = (UIViewController *)[secondStoryBoard instantiateViewControllerWithIdentifier:@"myTabBar"];

// Then push the new view controller in the usual way:
[self.navigationController pushViewController:theTabBar animated:YES];

这篇关于转到另一个故事板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆