Name | Type | iOS | tvOS | watchOS | macOS |
---|---|---|---|---|---|
textField |
Read-Only Property | 8+ | 9+ | - | - |
trimmedText |
Read-Only Property | 8+ | 9+ | - | - |
clear() |
Method | 8+ | 9+ | - | - |
Text field inside search bar (if applicable).
- type: Read-Only Property.
- return type: UITextField?
- availability:
iOS 8+
,tvOS 9+
. - unit tests:
iOS
,tvOS
.
Example
let searchBar = UISearchBar()
let textField = searchBar.textField
Text with no spaces or new lines in beginning and end (if applicable).
- type: Read-Only Property.
- return type: String?
- availability:
iOS 8+
,tvOS 9+
. - unit tests:
iOS
,tvOS
.
Example
let searchBar = UISearchBar()
let trimmedText = searchBar.trimmedText
Clear text.
- type: Method.
- return type: Void
- availability:
iOS 8+
,tvOS 9+
. - unit tests:
iOS
,tvOS
.
Example
let searchBar = UISearchBar()
searchBar.clear()