title: How i use UISearchController in UICollectionViewController using Swift
body: <p>I want to implement UISearchController in UICollectionViewController. But i don't want to implement search in CollectionView I need SearchController in Swift.</p>
  
  <p>I need to show Search Controller on Search Click </p>
  
  <pre><code>func searchBarCancelButtonClicked(_ searchBar: UISearchBar) { } 
  func searchBarResultsListButtonClicked(_ searchBar: UISearchBar) { }
  func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
    self.view.addSubview(searchController.view) 
  }
  func searchBarTextDidEndEditing(_ searchBar: UISearchBar) { }
  func updateSearchResultsForSearchController(searchController: UISearchController) {}
  func updateSearchResults(for searchController: UISearchController) { }
  </code></pre>
  
  <p>I am adding when search is active but not showing </p>
  
  <pre><code>let searchController = UISearchController(searchResultsController: nil) 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/CQLkW.png" /></p>
  
  <p>Please suggest me if any one have any idea .</p>