<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISearchBarDelegate/searchBarSearchButtonClicked(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UISearchBarDelegate(im)searchBarSearchButtonClicked:"
  },
  "title" : "searchBarSearchButtonClicked(_:)"
}
-->

# searchBarSearchButtonClicked(_:)

Tells the delegate that the search button was tapped.

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

## Parameters

`searchBar`

The search bar that was tapped.

## Discussion

You should implement this method to begin the search. Use the [`text`](/documentation/UIKit/UISearchBar/text) property of the search bar to get the text. You can also send [`becomeFirstResponder()`](/documentation/UIKit/UIResponder/becomeFirstResponder()) to the search bar to begin editing programmatically.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)