// as UISearchBar extension
extension UISearchBar {
func changeSearchBarColor(color : UIColor) {
for subView in self.subviews {
for subSubView in subView.subviews {
if subSubView.conformsToProtocol(UITextInputTraits.self) {
let textField = subSubView as UITextField
textField.backgroundColor = color
break
}
}
}
}
}
Last active
November 19, 2021 00:09
-
-
Save wavecos/970a0e0bad82d258c22c to your computer and use it in GitHub Desktop.
Customize Color, background from UISearchBar in Swift
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks!) but the height does not work (and the corner radius is not enough)