Code cleanup per code review

This commit is contained in:
Michael Kirk 2018-08-22 12:54:22 -06:00
parent e4b7d253a3
commit 1743407cc2
3 changed files with 3 additions and 6 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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]];