title: Added a UITableView programmatically, can't select a cell
body: <p>I am adding a tableview to my view controller with this method </p>
  
  <pre><code>func addTableView() {
      tableView = UITableView(frame: self.view.frame)
      tableView.tableHeaderView = UIView(frame: CGRectMake(0.0, 0.0, tableViewWidth, defaultHeaderY))
      tableView.backgroundColor = UIColor.clearColor()
      tapMapViewGesture = UITapGestureRecognizer(target: self, action: #selector(HomeViewController.mapViewTapped(_:)))// when header is tapped
      tapTableViewGesture = UITapGestureRecognizer(target: self, action: #selector(HomeViewController.tableViewTapped(_:)))// when when tableView itself is tapped
      tapTableViewGesture!.delegate = self
      tableView.tableHeaderView!.addGestureRecognizer(self.tapMapViewGesture!)
      tableView.addGestureRecognizer(self.tapTableViewGesture!)
      tableView.dataSource = self
      tableView.delegate = self
      tableView.allowsSelection = true
      view!.addSubview(self.tableView)
  
      let nib = UINib(nibName: "HomeCell", bundle: nil)
      self.tableView.registerNib(nib, forCellReuseIdentifier: "HomeCell")
  }
  </code></pre>
  
  <p>I want to add an action upon cell selection so I implemented the following method </p>
  
  <pre><code>func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
      print("did select")
  }
  </code></pre>
  
  <p>But nothing is being printed out when I select a cell. Did I miss something when I added the table view programmatically?</p>