Curnelious
Curnelious

Reputation: 1

Removing a flow of segues

Using storyboard i have created some flow of 4 view controllers . I have a UINavigation cotroller, that has some view controller as its root view . than from that root view i can go all the way to the 4th view .

Each was made with story board, and has its button , that i have control dragged to the next page, and set it as a modal transition` from the small menu.

Now when i dismiss the last view with :

[self dismissViewControllerAnimated:YES completion:nil];

I get to the previous view, which is good.

I would like now to remove all this stack including the navigation , with :

popToRootViewControllerAnimated:

Which is doing nothing.

Upvotes: 0

Views: 40

Answers (1)

Sergey Kalinichenko
Sergey Kalinichenko

Reputation: 726479

If you want to go all the way back to the root view controller, use this code:

[self.view.window.rootViewController dismissViewControllerAnimated:YES completion:nil];

Note: if you wish to dismiss all the additional view controllers from the context of an application delegate, say, in response to the application going into background, pass NO for the value of the animated parameter.

The reason I didn't wanted to push is because the upper bar that you get when you push ,and I don't want that

Navigation view controller lets you hide the navigation bar if you do not want end-users to see it.

Upvotes: 2

Related Questions