I have a view controller VC1 and I am doing following two operations on it:
- Push another view controller VC2 from VC1's navigation controller by calling
[VC1.navigationController pushViewController: animated:YES];
Present another view controller VC3 from VC1 by calling.
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:VC3]; [VC1 presentViewController:navController animated:YES completion:nil];
Now when I am coming from VC2 to VC1 I am calling
[VC2.navigationController popViewControllerAnimated:YES];
and from VC3 to VC1 I am calling
[VC3.navigationController dismissViewControllerAnimated:YES completion:nil];
My question is when I am coming back to VC1 how do I know that whether I am coming from VC2(by dismissing) or VC3(by popping)?
Note: VC1 is loaded as child view controller inside a parent view controller VC4.