如何加载StoryBoard

        **加载StoryBoard的步骤:**

1.获取storyboard对象

UIStoryboard *storyB = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];

2.storyboard中 ID的填写(storyboard ID)获取控制器
如何加载StoryBoard_第1张图片

TopDetailViewController *topDetailVC = [storyB instantiateViewControllerWithIdentifier:@"topDetailViewController"];  //@"topDetailViewController" 故事板自定义的id号

也可以不通过id获取控制器,不过是入口的控制器
如何加载StoryBoard_第2张图片

TopViewController *topDetailVC = [storyB instantiateInitialViewController];

push到其他页面可以隐藏标签栏:

 [self.navigationController pushViewController:topDetailVC animated:YES];

push到其他页面:

 [self.navigationController pushViewController:topDetailVC animated:YES];

你可能感兴趣的:(如何加载StoryBoard)