iOS UISearchController

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

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



Got any iOS Question?