iOS UISearchController


  • UISearchController(searchResultsController: UIViewController?) // Pass nil as the parameter if the search updating controller also displays the searchable content.
  • func updateSearchResults(for searchController: UISearchController) // Required method to implement when adopting the UISearchResultsUpdating protocol


UISearchController.searchBarThe search bar to install in your interface. (read-only)
UISearchController.searchResultsUpdaterThe object responsible for updating the contents of the search results controller.
UISearchController.isActiveThe presented state of the search interface.
UISearchController.obscuresBackgroundDuringPresentationA Boolean indicating whether the underlying content is obscured during a search.
UISearchController.dimsBackgroundDuringPresentationA Boolean indicating whether the underlying content is dimmed during a search.
UISearchController.hidesNavigationBarDuringPresentationA Boolean indicating whether the navigation bar should be hidden when searching.
UIViewController.definesPresentationContextA Boolean value that indicates whether this view controller's view is covered when the view controller or one of its descendants presents a view controller.
UIViewController.navigationItem.titleViewA custom view displayed in the center of the navigation bar when the receiver is the top item in which a search bar can be placed.
UITableViewController.tableView.tableHeaderViewReturns an accessory view that is displayed above the table in which a search bar can be placed.


UIKit Framework Reference: