I have the following settings for the UISearchBar:
searchBar?.tintColor = UIColor.clear
searchBar?.barTintColor = UIColor.clear
searchBar?.backgroundColor = UIColor.clear
searchBar?.layer.backgroundColor = UIColor.clear.cgColor
searchBar?.layer.borderColor = UIColor.clear.cgColor
searchBar?.layer.shadowColor = UIColor.clear.cgColor
searchBar?.backgroundImage = UIImage()
And this is how the UISearchBar appears:
Activated:
I am not sure where I am getting the gray in the background. I have inherited a codebase that's using UIAppearence Proxy, but I don't see anything for UISearchBar. Perhaps, the searchBar is inheriting it from elsewhere.
Any ideas on how to get rid of the the gray color?


First, delete all this:
Go to the Storyboard and change Bar Tint to your background color.