A text field–like control that supports text-based searches.
- iOS 2.0+
- tvOS 9.0+
UISearch provides a text field for entering text, a search button, a bookmark button, and a cancel button. A search bar does not actually perform any searches. You use a delegate, an object conforming to the
UISearch protocol, to implement the actions when text is entered and buttons are clicked.
You can customize the appearance of search bars one at a time, or you can use the appearance proxy (
[UISearch) to customize the appearance of all search bars in an app.
In general, you should specify a value for the normal state to be used by other states which don’t have a custom value set. Similarly, when a property is dependent on the bar metrics (on iPhone, in landscape orientation bars have a different height from standard), you should specify a value for
For more information about appearance and behavior configuration, see Search Bars.