---
title: "searchBarSearchButtonClicked(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uisearchbardelegate/searchbarsearchbuttonclicked(_:)"
---

# searchBarSearchButtonClicked(_:)

Tells the delegate that the search button was tapped.

## Declaration

```swift
optional func searchBarSearchButtonClicked(_ searchBar: UISearchBar)
```

## Parameters

- `searchBar`: The search bar that was tapped.

## Discussion

Discussion You should implement this method to begin the search. Use the text property of the search bar to get the text. You can also send becomeFirstResponder() to the search bar to begin editing programmatically.

## See Also

### Responding to clicks in search controls

- [searchBarBookmarkButtonClicked(_:)](uikit/uisearchbardelegate/searchbarbookmarkbuttonclicked(_:).md)
- [searchBarCancelButtonClicked(_:)](uikit/uisearchbardelegate/searchbarcancelbuttonclicked(_:).md)
- [searchBarResultsListButtonClicked(_:)](uikit/uisearchbardelegate/searchbarresultslistbuttonclicked(_:).md)
