title: Pushing Navigation Controller From Other Class in Swift
body: <p>I have a Data Manager class that handles some JSON activities. When one action is completed, I want to push to the Navigation controller. </p>
  
  <p>The FirstViewController calls a function on the DataManager Class</p>
  
  <p><strong><em>DataManager Class</em></strong></p>
  
  <pre><code>class func extract_json(data:NSData) -&gt; Bool {
      //Success
      FirstViewController().pushToValueView()
  }
  </code></pre>
  
  <p><strong><em>FirstViewController Class</em></strong></p>
  
  <pre><code>func pushToValueView() {
      println("Push to Value View")
      navigationController?.pushViewController(ValueViewController(), animated: true)
  }
  </code></pre>
  
  <p>In this example, <code>println()</code> is called but no push occurs. If I call <code>pushToValueView()</code> within FirstViewController e.g. <code>self.pushToValueView()</code> (For debug purposes), a push does occur. </p>