Franck
Franck

Reputation: 9359

UINavigationController, force stack

Question about UINavigationController

Let's say I have 5 UiViewController each one push the next one.

vc1 --> vc2 --> vc3 --> vc4 --> vc5
vc1 <-- vc2 <-- vc3 <-- vc4 <-- vc5

If I want to add a UIButton on vc1 who push to vc4, but I want also vc4 to go to vc3 at popViewController

vc1 --> --> vc4
vc1 <-- vc2 <-- vc3 <-- vc4

Was the best way to use: ?

[self.navigationController setViewControllers:newViewControllers animated:NO];

Upvotes: 0

Views: 46

Answers (1)

Leo
Leo

Reputation: 24714

If you use

[self.navigationController setViewControllers:newViewControllers animated:NO];

There is no animation

So,try this In vc1

[self.navigationController pushViewController:vc2 animated: NO]; 
[self.navigationController pushViewController:vc3 animated: NO];
[self.navigationController pushViewController:vc4 animated: YES];

Upvotes: 1

Related Questions