I have looked tirelessly through SO and haven't found out how to do this. How do I hide the cursor from my searchBar after the user is done searching? It just keeps blinking when the user doesn't need it to.
For normal UITextField
s, if you set the tintColor
property to .clear
, the cursor will hide.
Similarly, for a UISearchBar
, I would try
let sb = UISearchBar()
sb.searchTextField.tintColor = .clear
OR
let sb = UISearchBar()
sb.tintColor = .clear
Let me know if it works.