title: Custom cell with UISearchController in UITableViewController (result controller)
body: <p>I am trying to implement a UISearchController (not UISearchDisplayController which is deprecated)</p>
  
  <p>I face a ridiculously time eating issue.</p>
  
  <p>When I try to <code>dequeueResusableCellWithIdentifier</code> it doesn't works with my <code>CellAutocompletion</code> (UITableViewCell subclassing)</p>
  
  <p>Like this : </p>
  
  <pre><code>override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      let item = filteredProducts[indexPath.row]
  
      let cell:CellAutocompletion = self.tableView.dequeueReusableCellWithIdentifier("suggestionCell") as! CellAutocompletion
  
      cell.itemLabel?.text = item.item_name;
  
      return cell
  }
  </code></pre>
  
  <p>This throw me <code>fatal error: unexpectedly found nil while unwrapping an Optional value</code></p>
  
  <p><strong>BUT</strong> when I do this : </p>
  
  <pre><code>    let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "suggestionCell");
  </code></pre>
  
  <p>It works. So with a Default iOS cell, it works, with my custom cell not. Any idea?</p>
  
  <p>I think I ask the wrong tableview but considering I am inside a TableviewController included inside UISearchController which is used by another VC, I am lost.</p>
  
  <p><strong>My main VC</strong> which instanciate my searchController and the TableViewController where I have issue.</p>
  
  <pre><code>    //ViewDidLoad
      resultsTableController = ProductResultTabController();
      resultsTableController.tableView.delegate = self;
  
      self.searchController = UISearchController(searchResultsController: resultsTableController);
      searchController.searchResultsUpdater = self;
      searchController.dimsBackgroundDuringPresentation = true;
  
      searchController.searchBar.sizeToFit()
      tableView.tableHeaderView = searchController.searchBar
  </code></pre>
  
  <p><strong>My CustomCell Class</strong></p>
  
  <pre><code>class CellAutocompletion:UITableViewCell{
  
  @IBOutlet weak var itemLabel: UILabel!
  @IBOutlet weak var parentItemLabel: UILabel!
  
  }
  </code></pre>
  
  <p><strong>ProductResultTabController</strong> (subclass of TableViewController)</p>
  
  <pre><code>class ProductResultTabController: UITableViewController {
  var filteredProducts = [ITEM]();
  
  override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
      return 1;
  }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return filteredProducts.count
  }
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let item = filteredProducts[indexPath.row]
  
      let cell:CellAutocompletion = self.tableView.dequeueReusableCellWithIdentifier("suggestionCell") as! CellAutocompletion!
  
      cell.itemLabel?.text = item.item_name;
  
      return cell
  }
  
  
  }
  </code></pre>