title: can't set prepare for segue in iOS
body: <p>I have two controllers with <code>UINavigationController</code> (<code>UIViewController</code>(root) and <code>UITableViewController</code>). I need to click action at <code>UIViewController</code> and print something when move to <code>UITableViewController</code></p>
  
  <p><em>TableViewController.swift</em></p>
  
  <pre><code>func printString() {
      print("hello world")
  }
  </code></pre>
  
  <p><em>ViewController.swift</em></p>
  
  <pre><code>override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
      if segue.identifier == "sendData" {
          let navController = segue.destinationViewController as! UINavigationController
          let controller = navController.topViewController as! TableViewController
          controller.printString()
      }
  }
  </code></pre>
  
  <p>And after click I see that</p>
  
  <blockquote>
    <p>Could not cast value of type 'myProjectName.TableViewController' (0x5a068) to 'UINavigationController' (0x17ffed4).</p>
  </blockquote>
  
  <p>Why is that happening?</p>