UISearch class implements a text field control for text-based searches. The control provides a text field for entering text, a search button, a bookmark button, and a cancel button. The
UISearch object 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.
- iOS 2.0+
- tvOS 9.0+
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.