I\'ve been trying search results for hours, but I can\'t get this figured out. Perhaps it isn\'t possible. I\'m trying to change the tint color of the placeholder text and m
extension UISearchBar {
var textField: UITextField? { return value(forKey: "searchField") as? UITextField }
var placeholderLabel: UILabel? { return textField?.value(forKey: "placeholderLabel") as? UILabel }
var icon: UIImageView? { return textField?.leftView as? UIImageView }
var iconColor: UIColor? {
get {
return icon?.tintColor
}
set {
icon?.image = icon?.image?.withRenderingMode(.alwaysTemplate)
icon?.tintColor = newValue
}
}
}