I have the following situation:
view controller A -> presents modally -> view controller B
view controller B -> presents modally -> view controller C
I would like to dismiss view controller "C" and go directly to "A" instead of showing "B" since it do not make sense to show "B" at that time.
How can I accomplish that ?
Thanks, Daniel
In 'view controller C' ->
Before iOS 6: Use
[self.parentViewController.parentViewController dismissModalViewControllerAnimated:YES];
Or,
[self.presentingViewController.presentingViewController dismissModalViewControllerAnimated:YES];
From and Above iOS 6: Use
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
You can use segues to present view controllers from other view controllers.
To go backwards through a hierarchies you normally dismiss presented view controllers or you go back to specific view controllers through unwind segues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With