模态跳转和返回
第一个Controller中的
// 模态跳转
- (void)buttonAction:(UIButton *) button {
FirstViewController *firstVC = [[FirstViewController alloc] init];
firstVC.view.backgroundColor = [UIColor whiteColor];
[firstVC setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentViewController:firstVC animated:YES completion:^{
}];
}
第二个Controller中的
- (void)buttonAction:(UIButton *) button {
// 移除模态效果 页面切换
[self dismissViewControllerAnimated:YES completion:^{
NSLog(@"模态消失");
}];
}