Pass data between ViewController and TabBarController
<p>I have couple of questions.
How to pass the data (which i got after the Alamofire request is finished), to one of children of TabBarController?</p>

<p>The first problem i have is that i can't override the func prepareForSegue inside login action(when the button is tapped), it says i can override only class members. But if i put the func outside of IBAction then i won't send the data that i need.</p>

<p>And the second problem is, when i put the overrided function outside of IBAction, and the code look like this: </p>

<pre><code> override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {

            let homeVC = segue.destinationViewController as HomeViewController
            homeVC.templateForCell = templates
        }
</code></pre>

<p>when i run it, i got the error:</p>

<blockquote>
  <p>Could not cast value of type 'UITabBarController'  to
  HomeViewController'</p>
</blockquote>

<p>(HomeViewController is my destination view, where i should pass the data from Alamofire).</p>