欢迎使用CSDN-markdown编辑器

来源:互联网 发布:红警2单位数据 编辑:程序博客网 时间:2024/06/14 10:33

使用多个Storyobard

代码如下:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"CustomSB" bundle:nil];UIViewController* vc = (UIViewController *)[storyboard instantiateViewControllerWithIdentifier:@"sb"];vc.navigationItem.title = @"SB";[self.navigationController pushViewController:vc animated:YES];

代码解释:

  1. 通过名称获取你要跳转到的storyBoard
  2. 初始化你自定义的storyBoard中的viewController(注意为的destination viewController添加StoryBorad identifier)
  3. 然后压入到你当前的导航栈中(当前 vc 没有navigationController的情况还待研究完善)

0 0
原创粉丝点击