Reputation: 779
I know how to initialise the UIsearchcontroller by doing this:
let searchResultsController = UITableViewController(style: .Plain) as UITableViewController
searchResultsController.tableView.delegate = self
searchResultsController.tableView.dataSource = self
searchController = UISearchController(searchResultsController: searchResultsController)
so, I have a button on navigation bar and on press I want to display SearchBar using UISearchController and then dismiss the search bar on tapping again on the search button or empty space of screen.
Upvotes: 1
Views: 1616
Reputation: 538
According to documentation, changing active
property of search controller will move search bar to navigation bar
Upvotes: 0