searchBar
The search bar to install in your interface.
Declaration
var searchBar: UISearchBar { get }Discussion
Before presenting your searchable content, install the search bar somewhere in your view hierarchy. The search bar becomes the starting point for searching your contents. Interactions with the search bar are handled automatically by the UISearchController object, which notifies the object in the searchResultsUpdater property whenever the search information changes.
You can provide a custom search bar by subclassing UISearchController and overriding this property to return your custom implementation. To ensure the correct configuration of your search bar, lazily initialize it when it’s first requested, as shown in the code below.