160°

跳转到 xib、storyboard 界面

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
UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Me" bundle:nil];

ReceiptAddressVC *vc = [mainStoryBoard instantiateViewControllerWithIdentifier:@"ReceiptAddressVC"]; [self.navigationController pushViewController:vc animated:YES];

本文由【Jack088】发布于开源中国,原文链接:https://my.oschina.net/jack088/blog/3158175

全部评论: 0

    我有话说: