스토리보드에서 push로 지정했으나, 상황에 따라 다른 뷰로 이동하고 싶다.
버튼에서 이동할 페이지로 push를 걸어버리면, prepareForSegue에서 무슨짓을 하든 이동해버린다.
뷰컨트롤 하단의 뷰컨트롤러를 끌어서 이동한 페이지와 push로 연결한후 segue에 식별자를 준다.
if(case1){
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"ErrorView"];
[self presentViewController:vc animated:YES completion:nil];
return;
}
// case2
[self performSegueWithIdentifier:@"TargetView"sender:self];
// TargetView는 Segue
NavigationController로 push
UIViewController *informationView = [storyboard instantiateViewControllerWithIdentifier:@"aaa"];
[self.navigationController pushViewController:informationView animated:YES];
돌아갈땐
[self.navigationController popVieController];
/// 커스텀 클래스 연결해 놓은 멤버변수가 설정이 안된다???