Stats

169 Contributors: 4 Wednesday, February 8, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

UISearchController

Syntax

  • 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

Parameters

ParameterDetails
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.

Remarks

UIKit Framework Reference:

UISearchController

UISearchResultsUpdating

Related Examples