I am making an iOS app where I want to present a flow of pages like this:
Basically I want to achieve is to have this flow of pages:
PageA
PageB
PageC
PageD, dismiss back to:
PageC
PageD
PageE, dismiss back to:
PageA (starting point, start over again)
I am using ShowViewcontroller
to present the pages (modal) and DismissViewcontroller
to dismiss.
As per Apple's documentation if I dismiss a VC early in the stack all subsequent UIViewCOntroller
are dismissed too (Apple doc).
However I experience that ViewWillAppear
and ViewDidAppear
are fired on the UIViewController
that are dismissed even when they do not appear (e.g. in the example when dismissing back to PageA
from PageE
then ViewWillAppear
is called on PageD
, PageC
, PageB
too).
This does not seem logical to me. Can anyone explain why this is happening? And perhaps correct me if I am approaching this the wrong way.
I am using Xamarin.iOS.
Apple doc: If you present several view controllers in succession, thus building a stack of presented view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack.