title: Disable Cell Swipe Action
body: <p>So I have an app(written in Swift) that allows a user to search for golf courses in a searchController. They can then select that course and then that selected course goes into a tableView. I'm using the same view controller for both the search controller and the list of the selected courses. </p>
  
  <p>The issue I'm having is I want the user to have the ability to swipe to delete their selected courses but NOT the courses that populate search controller when it is active. The swipe to delete action is working in the regular tableView. When the searchController is active I have it to the point where the delete button is disabled. BUT what I want to do is not have the cells be able to slide at all if the searchController is active. Can't seem do get it work. Any suggestions? Please and thank you.</p>
  
  <p>Here is my code:</p>
  
  <pre><code> override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
  
      if searchController.active {
  
      UITableViewCellEditingStyle.None
  
      } else {
  
      let deletedValue = previousCoursesFromRealm[indexPath.row]
  
      if editingStyle == UITableViewCellEditingStyle.Delete {
          let realm = try! Realm()
          try! realm.write {
          realm.delete(deletedValue)
          }
  
       coursesTableView.reloadData()
  
       }
      }
     }  
  </code></pre>