I would like to know how to hide or not display the UISearchBar
cross that appears in the textField
fo the UISearchBar
I have
Converting Soto_iGhost's answer to Swift 4:
func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
let textField: UITextField = searchBar.value(forKey: "_searchField") as! UITextField
textField.clearButtonMode = .never
}
If you have an outlet of UISearchBar
the you can write above code anywhere in your class.