title: How to pass parameters from appDelegate to ViewController?
body: <p>I need to pass some parameters from the appDelegate to a viewController before loading it.</p>
  
  <p>This is the code i'm trying to use (in the appDelegate.swift):</p>
  
  <pre><code>let storyboard = UIStoryboard(name: "Main", bundle: nil)
  let secondView = storyboard.instantiateViewControllerWithIdentifier("tab") as UITabBarController
  secondView.variable = "xxxx"
  self.window?.rootViewController = secondView;
  </code></pre>
  
  <p>but the compiler shows the following error:</p>
  
  <blockquote>
    <p>UITabBarController does not have a member named 'variable'</p>
  </blockquote>
  
  <p>Even thought, in the TabBarController class (TabBarController.swift) i have the following:</p>
  
  <pre><code>import UIKit
  class TabBarController: UITabBarController {
  var variable:String!
  ...etc
  </code></pre>
  
  <p>What's the error?
  Please give a clear explanation as i'm a beginner in Swift.
  Thank you very much!!</p>