0
点赞
收藏
分享

微信扫一扫

[ios]多个storyboard跳转


1、单个storyboard跳转


UIStoryboard *board = self.storyboard;
HomeController *homevc = [board instantiateViewControllerWithIdentifier:@"homevc"];
[self.navigationController pushViewController: homevc animated:YES];

2.多个:


UIStoryboard *board = [UIStoryboard storyboardWithName:@"Login" bundle:nil];
LoginController *loginvc = [board instantiateViewControllerWithIdentifier:@"loginvc"];
[self.navigationController pushViewController: loginvc animated:YES];

PS:在有多个storyboard的情况下,都要替换成这种声明方式

 

*不同跳转方式:

//Modal方式



[self presentModalViewController:my_device_vc animated:YES];
//使用了navitgation

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


//回退


[self.navigationController popViewController animated:YES];


 

swift:

let bookDateVC = UIStoryboard(name: "Book-date", bundle: nil).instantiateViewController(withIdentifier: "book-date")
bookDateVC.title = "预约日期及时间"
self.navigationController?.pushViewController(bookDateVC, animated: true)

 

 

举报

相关推荐

0 条评论