title: Search bar in UITableView for Realm objects
body: <p>I have a table view populated by Realm Objects, and when i click on a cell, it takes me to another view that shows me more information about that Object. I want to add a search bar for this table view to check for the objects' "fullName" property. I know how to add a search bar for an array of strings, but I haven't found any tutorial or guidance on how to do it using Swift 2.0. Any help please?</p>
  
  <p>EDIT: That's how i'm populating my tableview</p>
  
  <pre><code>var dataSource : Results&lt;Patient&gt;!
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      let identifier: String = "myCell"
      var cell = tableView.dequeueReusableCellWithIdentifier(identifier)
  
      if cell == nil {
          cell = UITableViewCell(style: .Subtitle, reuseIdentifier: identifier)
      }
  
      let currentPatientInfo = dataSource[indexPath.section]
  
      cell?.textLabel?.text = currentPatientInfo
      cell?.accessoryType = UITableViewCellAccessoryType.DetailDisclosureButton
  
      return cell!
  
  }
  </code></pre>
  
  <p>I have the data in sections, not rows</p>
  
  <p>EDIT: I added <code>RealmSwiftSearchController</code> to my project but occasionally i get this error when i click on a cell :</p>
  
  <blockquote>
    <p>fatal error: unexpectedly found nil while unwrapping an Optional value</p>
  </blockquote>
  
  <p>and it points to this code :</p>
  
  <pre><code>extension RealmSearchViewController {
  
  
   public override func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -&gt; NSIndexPath? {
  
  // The line below
      let object = self.fetchedResultsController.objectAtIndexPath(indexPath) as! Object
  // Line ends
          self.resultsDelegate.searchViewController(self, willSelectObject: object, atIndexPath: indexPath)
  
          return indexPath
      }
  </code></pre>