Code cleanup per code review
This commit is contained in:
parent
e4b7d253a3
commit
1743407cc2
|
@ -69,12 +69,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
if (Theme.isDarkThemeEnabled) {
|
||||
UIImage *clearImage = [UIImage imageNamed:@"searchbar_clear"];
|
||||
[self setImage:[clearImage templatedWithColor:foregroundColor]
|
||||
[self setImage:[clearImage asTintedImageWithColor:foregroundColor]
|
||||
forSearchBarIcon:UISearchBarIconClear
|
||||
state:UIControlStateNormal];
|
||||
|
||||
UIImage *searchImage = [UIImage imageNamed:@"searchbar_search"];
|
||||
[self setImage:[searchImage templatedWithColor:foregroundColor]
|
||||
[self setImage:[searchImage asTintedImageWithColor:foregroundColor]
|
||||
forSearchBarIcon:UISearchBarIconSearch
|
||||
state:UIControlStateNormal];
|
||||
} else {
|
||||
|
|
|
@ -20,7 +20,7 @@ extension UIImage {
|
|||
}
|
||||
|
||||
@objc
|
||||
public func templated(color: UIColor) -> UIImage? {
|
||||
public func asTintedImage(color: UIColor) -> UIImage? {
|
||||
let template = self.withRenderingMode(.alwaysTemplate)
|
||||
let imageView = UIImageView(image: template)
|
||||
imageView.tintColor = color
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
// ? UIKeyboardAppearanceDark
|
||||
// : UIKeyboardAppearanceDefault);
|
||||
|
||||
// [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor
|
||||
// ows_materialBlueColor]];
|
||||
|
||||
[[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]];
|
||||
[[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]];
|
||||
|
||||
|
|
Loading…
Reference in New Issue