searchDisplayController(_:shouldReloadTableForSearchScope:)
Asks the delegate if the table view should be reloaded for a given scope.
Declaration
optional func searchDisplayController(_ controller: UISearchDisplayController, shouldReloadTableForSearchScope searchOption: Int) -> BoolParameters
- controller:
The search display controller for which the receiver is the delegate.
- searchOption:
The index of the selected scope button in the search bar.
Return Value
true if the display controller should reload the data in its table view, otherwise false.
Discussion
If you don’t implement this method, then the results table is reloaded as soon as the scope button selection changes.
You might implement this method if you want to perform an asynchronous search: you would initiate the search in this method, then return false, and reload the table when you have results.