How to change the color of the UISearchBar Icon?

The searchIcon is located in the leftView of the searchTextField. Since this is accessible we can easily set the tintColor for the view. The tintColor is also used for the searchIcon.

So in your code you can change the search icon to white with the following code:

searchBar.searchTextField.leftView?.tintColor = .white

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)