title: Dismiss Keyboard On drag
body: <p>I would like to dismiss the keyboard on swipe/drag after i search for results in my <code>searchController</code>.</p>
  
  <p>I tried doing it through the <code>main.storyboard</code> but it didn't help.</p>
  
  <p>if i search and get many results i would like scroll down and then the keyboard will <code>dismiss</code> and let me see my results better.If anyone can help that would be great, Thanks ahead !</p>
  
  <p>Right now, When i have my results as seen in the picture the keyboard stays when i scroll down and its kind of annoying.</p>
  
  <p>I am using Swift 2.3 and Xcode 8.1</p>
  
  <p><a href="https://i.stack.imgur.com/al1Yd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/al1Yd.png" alt="enter image description here"></a></p>
  
  <p>Here is my searchController setup just in case :</p>
  
  <pre><code>// MARK : Search ! //
  
      var searchController : UISearchController!
  
      var resultsController = UITableViewController()
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          definesPresentationContext = true
          self.resultsController.tableView.dataSource = self
          self.resultsController.tableView.delegate = self
          self.searchController = UISearchController(searchResultsController: self.resultsController)
          self.tableView.tableHeaderView = self.searchController.searchBar
          self.searchController.searchResultsUpdater = self
          self.searchController.dimsBackgroundDuringPresentation = true
          self.searchController.searchBar.sizeToFit()
          self.searchController.searchBar.barTintColor = UIColor.blackColor()
          self.searchController.searchBar.endEditing(true)
          self.searchController.searchBar.placeholder = "חפש ברים"
          self.searchController.hidesNavigationBarDuringPresentation = false
          ////// MARK: END Of Search //////
  }
  </code></pre>
  
  <h1><strong>Edit:pkc456 Has Solved it.Works,but has a tiny issue</strong></h1>
  
  <p>The last result's Cell is being cut in half! :</p>
  
  <p><a href="https://i.stack.imgur.com/1aLbM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1aLbM.png" alt="enter image description here"></a></p>