title: ViewWillAppear & ViewDidAppear firing when dismissing ViewController
body: <p>I am making an iOS app where I want to present a flow of pages like this:</p>
  
  <p>Basically I want to achieve is to have this flow of pages:</p>
  
  <pre><code>PageA
  PageB
  PageC
  PageD, dismiss back to:
  PageC
  PageD
  PageE, dismiss back to:
  PageA (starting point, start over again)
  </code></pre>
  
  <p>I am using <code>ShowViewcontroller</code> to present the pages (modal) and <code>DismissViewcontroller</code> to dismiss.</p>
  
  <p>As per Apple's documentation if I dismiss a VC early in the stack all subsequent <code>UIViewCOntroller</code> are dismissed too (<a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/#//apple_ref/occ/instm/UIViewController/dismissViewControllerAnimated:completion:" rel="nofollow">Apple doc</a>).</p>
  
  <p>However I experience that <code>ViewWillAppear</code> and <code>ViewDidAppear</code> are fired on the <code>UIViewController</code> that are dismissed even when they do not appear (e.g. in the example when dismissing back to <code>PageA</code> from <code>PageE</code> then <code>ViewWillAppear</code> is called on <code>PageD</code>, <code>PageC</code>, <code>PageB</code> too).</p>
  
  <p>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.</p>
  
  <p>I am using Xamarin.iOS.</p>
  
  <p><strong>Apple doc:</strong>
  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.</p>