Sorry but none of the similar questions provide a working solution.
New single-view project. Storyboard actions:
- VC1 is embedded in nav-controller
- a button in VC1 activates a push seque into VC2
- a button in VC2 activates a modal segue into VC3
- VC3 has a button, and a UIViewController-subclass to handle the button action
Problem statement: How can I have the button of the modal VC3 close both VC3 and VC2 at once, taking me back to VC1?
This did not work - takes me to VC2 only:
- (IBAction)dismissPressed:(id)sender {
UINavigationController *myNavController = [self navigationController];
[self dismissViewControllerAnimated:NO completion:^{
[myNavController popToViewController:[myNavController.viewControllers objectAtIndex:1] animated:NO];
}];
}
Thank you very much!