title: Determine the first time a UIViewController appears
body: <p>Before <a href="https://stackoverflow.com/questions/3436307/how-can-i-determine-if-a-view-has-been-loaded-for-the-first-time">resorting to custom flags</a> I wanted to check this with you people. </p>
  
  <p>Is there a built-in way to determine in <code>viewWillAppear:</code> or <code>viewWillDisappear:</code> whether the UIViewController is 'newly pushed' onto a UINavigationController's stack, or whether the navigation controller has popped another view off, revealing this one? I want to execute some one-off code the first time the view appears. Because the <code>self.bounds</code> property needs to be set, the <code>viewDidLoad:</code> method is not the right place.</p>
  
  <p>I was hoping to get some results with what I'm using to <a href="https://stackoverflow.com/questions/5991736/get-notified-when-a-view-controller-is-about-to-be-popped-in-ios4">determine something similar on <code>viewWillDisappear:</code></a>, but on the first <code>viewWillAppear:</code> the index is already set to 1:</p>
  
  <pre><code>[self.navigationController.viewControllers indexOfObject:self]
  </code></pre>
  
  <p>So this is a useless snippet. Any ideas?</p>