Search code examples
objective-cuiviewcontrollermodalviewcontroller

Switch current UIVIewController on stack


I have my root view (A) and a view I present modally (B). On B I want to display a new view (C) to replace B on the stack, that way when I call removeModalViewController or whatever it goes back to A.

So the stack first looks like this A->B

Then in B, a tap of a button changes the stack to A->C

How would I do this? I've tried a million different things with no success


Solution

  • Easy fix, just tell B to dismissModalViewController with animated = NO. Right when you do this, present C as a modal view controller, also not animated.