init(searchResultsController:)
Creates and returns a search controller with the specified view controller for displaying the results.
Declaration
init(searchResultsController: UIViewController?)Parameters
- searchResultsController:
The view controller that displays the search results. Specify
nilif you want to display the search results in the same view controller that displays your searchable content. For apps running in tvOS, provide a results controller because tvOS doesn’t acceptnilas a valid argument.
Return Value
An initialized search controller.
Discussion
After creating the search controller, always assign an object to the searchResultsUpdater property. The search controller uses that object to update the search results.