从故事板到XIB [英] Segue from Storyboard to XIB
本文介绍了从故事板到XIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个故事板视图控制器,这是我应用中的第一个屏幕。该应用程序的其余部分使用xib设计。我想从故事板的VC中的按钮到XIB文件。我知道如何从xib到storyboard这样做,但是这个怎么样?
I have a storyboard View Controller, which is the first screen in my app. The rest of the app is designed with xib's. I want to segue from a button in the storyboard's VC to a XIB file. I know how to do this from a xib to storyboard, but how about this ?
提前致谢!
推荐答案
从xib到故事板
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
UIViewController *initViewController = [storyBoard instantiateInitialViewController];
然后
[self.window setRootViewController:initViewController];
或
[self.navigationController pushViewController:initViewController animated:YES];
从故事板到xib
YourViewController *viewController=[[YourViewController alloc]initWithNibName:@"ViewControllerName" bundle:nil];
[self presentViewController:viewController animated:YES completion:nil];
如果是NavigatinController
In case of NavigatinController
[self.navigationController pushViewController:viewController animated:YES];
这篇关于从故事板到XIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文