Reject view controller view

I have the following situation:

view controller A β†’ represents modally β†’ view controller B

view controller B β†’ represents modally β†’ view controller C

I would like to disable the view controller β€œC” and go directly to β€œA” instead of displaying β€œB”, because at this time it makes no sense to show β€œB”.

How can i do this?

Thanks Daniel

+7
ios objective-c
source share
4 answers

You can use segues to represent view controllers from other view controllers.

To go back through hierarchies, you usually fire the presented view controllers or return to specific view controllers through unwinding segments .

+3
source share

In the 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]; 
+6
source share

Try the following:

 [vcB dismissModalViewControllerAnimated:NO] //no Animation, so happens instantly [vcA dismissModalViewControllerAnimated:YES] //with Animation, this is all you see 
+1
source share

It’s best to use navigation controllers if your B and C are connected and are a more detailed version of A

A-> BC. You do not want to unwind the stack / pop the view controllers inserted on the stack.

Read this link very helpful - http://chrisrisner.com/Unwinding-with-iOS-and-Storyboards

+1
source share

All Articles