title: Passing a "User" object from one view controller to another
body: <p>I am working on a swift app and the task in hand is to send the retrieved "User" object to the next view controller.</p>
  
  <p>It starts with the Sign-In vc, where I make a request to the server and get back appropriate data:</p>
  
  <pre><code>import UIKit
  import Security
  
  class SignInVC: UIViewController {
  
      @IBOutlet weak var email_field: TextField!
      @IBOutlet weak var password_field: TextField!
      let httpHelper = HTTPHelper()
  
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  
      @IBAction func SignIn_Tapped(sender: AnyObject) {
          // ...
          if self.email_field.text!.characters.count &gt; 0 &amp;&amp;
              self.password_field.text!.characters.count &gt; 0 {
                  makeSignInRequest(self.email_field.text!, pass: self.password_field.text!)
          }
      }
  
      func makeSignInRequest(email:String, pass:String) {
          let httpRequest = httpHelper.buildRequest("login", method: "POST",
              authType: HTTPRequestAuthType.HTTPBasicAuth)
          httpRequest.HTTPBody = "{\"email\":\"\(email)\",\"password\":\"\(pass)\"}".dataUsingEncoding(NSUTF8StringEncoding);
          httpHelper.sendRequest(httpRequest, completion: {(data:NSData!, error:NSError!, description:NSMutableString!) in
              do {
                  let jsonData = try NSJSONSerialization.JSONObjectWithData(data!, options:NSJSONReadingOptions.MutableContainers ) as! NSDictionary
                  if let user = jsonData["user"]! as? NSDictionary {
                      let curr_user = User(
                          id: user["id"]! as! Int,
                          name: user["name"]! as! String,
                          pic_url: user["status"]! as! String
                      )
                      if let mainController = self.storyboard?.instantiateViewControllerWithIdentifier("NewTabViewController") as? UITabBarController {
                              print(curr_user)
                              self.navigationController?.pushViewController(mainController, animated: true)
                      }
                  } else {
                      print("error")
                  }
              } catch {
                  print("error")
              }
          })
      }
  }
  </code></pre>
  
  <p>Now, all I want to do is pass the <code>curr_user</code> object to <code>mainController</code>. But I am unable to figure out how.</p>
  
  <p>I have also been doing a lot of searching and multiple people have suggested Delegates and Protocols, but I have yet to find a good and relevant example. So if you are going to suggest that too, please provide some examples relative to my code.</p>