title: IOS : passing data between viewController (destination embedded in a NavigationController)
body: <p>I'm just learning IOS development, I would like to pass data between ViewController. I'm using Storyboard and I'm using the "prepareForSegue" method.</p>
  
  <p>My main question is about the pattern I found in many forums and blogs about this "transmission" of information. When the origin controller needs to pass data to a destination controller, the origin controller access the destination controller using the code :</p>
  
  <pre><code>[segue destinationViewController] 
  </code></pre>
  
  <p>This is fine, the origin controller doesn't need to know exactly the destination controller details (I'm using protocols).</p>
  
  <p>But when the destination controller is a NavigationController (a ViewController embedded in a NavigationController), it seems that the recommended practice is :</p>
  
  <pre><code>[[segue destinationViewController] topViewController]
  </code></pre>
  
  <p>But if I do that, it means that the origin controller must know that the destination controller IS a NavigationController. I would like to avoid that if possible ?</p>
  
  <p>Maybe I'm doing something wrong ? Is there another way to do it ?</p>
  
  <p>The origin controller is a "detail page" (coming from a TableView), the destination controller is the "edit page". </p>
  
  <p>Any help is welcome.</p>
  
  <p>Thanks</p>