[ios] Multiple storyboard jumps

1. Jump to a single storyboard

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

 

2. Multiple:

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

PS: In the case of multiple storyboards, it must be replaced with this declaration method

 

*Different jumping methods:

//Modal way

 

[self presentModalViewController:my_device_vc animated:YES];
 // used navigation
[self.navigationController pushViewController: loginvc animated:YES];
 

 //go back

[self.navigationController popViewController animated:YES];

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326245212&siteId=291194637