[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];

猜你喜欢

转载自jameskaron.iteye.com/blog/2368590