Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 1.16 KB

UISearchBarExtensions.md

File metadata and controls

65 lines (44 loc) · 1.16 KB

UISearchBar Extensions

Table of Contents

Name Type iOS tvOS watchOS macOS
textField Read-Only Property 8+ 9+ - -
trimmedText Read-Only Property 8+ 9+ - -
clear() Method 8+ 9+ - -

textField

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

trimmedText

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()

Clear text.

  • type: Method.
  • return type: Void
  • availability: iOS 8+, tvOS 9+.
  • unit tests: iOS, tvOS.

Example

let searchBar = UISearchBar()
searchBar.clear()