---
title: searchBar
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uisearchcontroller/searchbar
---

# searchBar

The search bar to install in your interface.

## Declaration

```swift
var searchBar: UISearchBar { get }
```

## Discussion

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.

## See Also

### Managing the search results

- [searchResultsUpdater](uikit/uisearchcontroller/searchresultsupdater.md)
- [searchResultsController](uikit/uisearchcontroller/searchresultscontroller.md)
- [isActive](uikit/uisearchcontroller/isactive.md)
