一 通过present 跳转,下面列举没有nav页面 或者 有nav页面 怎么实现
[self presentViewController:secondVC animated:YES completion:nil];
[self.navigationController presentViewController:sendVC animated:YES completion:nil];
返回调用这个
//从secondVC页面跳回firstVC
[self dismissViewControllerAnimated:YES completion:nil];
二,通过nav的push跳转,
[self.navigationController pushViewController:secondVC animated:NO];
返回的话可以通过pop 或者 popTo 返回
// 方法一:根据push, 从nav 栈中取出,指向mainVC
MainViewController *mainVC = [self.navigationController viewControllers][0];
[self.navigationController popToViewController:mainVC animated:YES];
// 方法二:根据push 出栈 直接返回上一级,从哪push返回到哪
// [self.navigationController popViewControllerAnimated:YES];
哦了搞定~~