
I have 3 views called A,B and C. The segue between them is "present modally". dismissViewControllerAnimated can be used to jump back to parent view controller, but does it have a way to jump from C to A directly?

I have 3 views called A,B and C. The segue between them is "present modally". dismissViewControllerAnimated can be used to jump back to parent view controller, but does it have a way to jump from C to A directly?
If you're using a storyboard, you can use an unwind segue to back up multiple steps in a view controller hierarchy.
- (IBAction)unwind:(UIStoryboardSegue *)segue. It needs to take a segue as the argument, not just any id sender.Unwind segues work by walking the parent and presenting view controller hierarchy until they find a controller that implements the chosen method. You don't have to put any code in this method; just to have it exist with an empty body is enough. Once the storyboard finds such a method, it will pop and dismiss view controllers until it reveals the one that implements that method.
if you want to directly jump to A and A is you rootViewcontroller then you can use this code in you C controller
self.navigationController?.popToRootViewControllerAnimated(true)
but if you want to pass a certain data from C controller to A controller then you have to use Segue these all are mentioned in navigationController class refer to : https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/NavigationControllers.html
Use Navigation stack for Push and Pop ViewControllers, and if you need to present and dismiss viewController then , you can try with UIAnimation with Navigation Push and Pop stack,
And then you can easily navigate to Parent ViewController with below Code.
[self.navigationController popToViewController:self.navigationController.viewControllers[self.navigationController.viewControllers.count - 3] animated:YES];
Hope , this may help you. !!!!!
Objective - C
UIViewController *prevVC = [self.navigationController.viewControllers objectAtIndex:IndexViewOfA];
//you get index of view (A,B,C) from array self.navigationController.viewControllers
[self.navigationController popToViewController:prevVC animated:YES];
This might helps you :)