Storyboard跳转传值
1、 Storyboard 模态(或Pop)指定控制器
UIStoryboard *sb_board = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; LoginController *vc_login = [sb_board instantiateViewControllerWithIdentifier:@"LoginController"]; [self presentViewController:vc_login animated:YES completion:nil];
2、 Storyboard Pop回指定控制器
UIStoryboard *sb_board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
CateWebController *vc_cate_web = [sb_board instantiateViewControllerWithIdentifier:@"CateWebController"];
for (UIViewController* vc in self.navigationController.viewControllers) {
if ([vc isKindOfClass:[vc_cate_web class]]) {
[self.navigationController popToViewController:vc animated:YES];
}
}
3、Storyboard(相连接)直接跳转
self.hidesBottomBarWhenPushed = YES; [self performSegueWithIdentifier:Identifier sender:self]; self.hidesBottomBarWhenPushed = YES;
4、Storyboard(相连接)传值
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
if ([segue.identifier isEqualToString:@"SegueDetail"])
{
DetailController *Detail = segue.destinationViewController;
Detail.strUrl = [NSString stringWithFormat:@"%@",self.str_url];
}
}
A-B-C C-A

浙公网安备 33010602011771号