ios 中实现storyboard 与xib 之间的切换

1,跳转到xib 
假设有一个按钮,这个按钮就是实现跳转的,那么在这个按钮的点击事件中,代码可以这样写。 
AViewController *a1= [[AViewController alloc]initWithNibName:@”AViewController” bundle:[NSBundle mainBundle]]; 
[self.navigationController pushViewController:a1 animated:YES]; 
2,跳转到storyboard 
如上,代码可以这样写 
UIStoryboard *sb=[UIStoryboard storyboardWithName:@”A” bundle:nil]; 
[self presentViewController:[sb instantiateInitialViewController] animated:YES completion:nil];

posted @ 2018-05-31 14:18  雪地里的Alan  阅读(393)  评论(0编辑  收藏  举报