title: Passing values from one view controller to another in Swift
body: <p>I am working on Swift, I've got an error in tableview's didSelectRowAtIndexPath method.
  I want to pass a value to another view controller i.e 'secondViewController'. Here EmployeesId is an Array. The relevant code is as follows:</p>
  
  <pre><code>func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
      var view: Dashboard = self.storyboard?.instantiateViewControllerWithIdentifier("Dashboard") as Dashboard
  
      self.navigationController?.pushViewController(view, animated: true)
      secondViewController.UserId = employeesId[indexPath.item]  //getting an error here.
  }
  </code></pre>
  
  <p>But I am getting this Error:
    fatal error: unexpectedly found nil while unwrapping an Optional value.</p>
  
  <p>Any help will be appreciated.</p>