我正在使用3个屏幕
1)VC1 - 故事板
2)VC2 --Xib
3)VC3-故事板
VC1是用户界面,如果用户输入用户ID并按登录用户可以移动VC2-Xib
如果用户输入能够移动VC3的4位针脚用户,则VC2是密码屏幕
我面临的是,
用户输入4位数后,它会移动到VC1,即用户屏幕.i需要移动VC2 这是我的代码,这是我解雇VC2的行,
[self dismissViewControllerAnimated:YES completion:nil];
在解除视图控制器之后它将转到VC1。请在解除此视图控制器后给出示例如何呈现VC3。请帮我这样做
答案 0 :(得分:0)
如果你想在解除vc2后以模态方式从vc1中呈现vc3,你可以在你当前设置为nil的dismiss方法的完成块中以编程方式呈现vc3。例如,你可以写:
[self dismissViewControllerAnimated:YES completion:^{
UIViewController *vc3 = [[UIStoryboard storyboardWithName:@"storyboardName" bundle:nil] instantiateViewControllerWithIdentifier:@"vc3Identifier"];
[self presentViewController:vc3 animated:YES completion:nil];
}];
当然,您必须使用正确的故事板名称和您应该在故事板中设置的视图控制器的故事板标识符。
如果你正在使用导航控制器,你也可以推送到你可以使用的导航控制器:
[self.navigationController pushViewController:vc3 animated:YES];
而不是:
[self presentViewController:vc3 animated:YES completion:nil];