<!--
{
  "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/searchBarTextDidEndEditing(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UISearchBarDelegate(im)searchBarTextDidEndEditing:"
  },
  "title" : "searchBarTextDidEndEditing(_:)"
}
-->

# searchBarTextDidEndEditing(_:)

Tells the delegate that the user finished editing the search text.

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

## Parameters

`searchBar`

The search bar that is being edited.

## Discussion

Typically, you implement this method to perform the text-based search.

---

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)