Skip to content

Commit 0217932

Browse files
authored
Merge pull request #8139 from woocommerce/issue/8119-remove-applyTintColorToiOS13
Remove not needed functions.
2 parents 333957c + c5b0e84 commit 0217932

File tree

4 files changed

+13
-33
lines changed

4 files changed

+13
-33
lines changed

WooCommerce/Classes/Extensions/UIButton+Helpers.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ extension UIButton {
2222

2323
let normalBackgroundImage = UIImage.renderBackgroundImage(fill: .primaryButtonBackground,
2424
border: .primaryButtonBorder)
25-
.applyTintColorToiOS13(.primaryButtonBackground)
25+
.withTintColor(.primaryButtonBackground)
2626
setBackgroundImage(normalBackgroundImage, for: .normal)
2727

2828
let highlightedBackgroundImage = UIImage.renderBackgroundImage(fill: .primaryButtonDownBackground,
2929
border: .primaryButtonDownBorder)
30-
.applyTintColorToiOS13(.primaryButtonDownBackground)
30+
.withTintColor(.primaryButtonDownBackground)
3131
setBackgroundImage(highlightedBackgroundImage, for: .highlighted)
3232

3333
let disabledBackgroundImage = UIImage.renderBackgroundImage(fill: .buttonDisabledBackground,
3434
border: .buttonDisabledBorder)
35-
.applyTintColorToiOS13(.buttonDisabledBorder) // Use border as tint color since the background is clear
35+
.withTintColor(.buttonDisabledBorder) // Use border as tint color since the background is clear
3636
setBackgroundImage(disabledBackgroundImage, for: .disabled)
3737
}
3838

@@ -54,17 +54,17 @@ extension UIButton {
5454

5555
let normalBackgroundImage = UIImage.renderBackgroundImage(fill: .secondaryButtonBackground,
5656
border: .secondaryButtonBorder)
57-
.applyTintColorToiOS13(.secondaryButtonBackground)
57+
.withTintColor(.secondaryButtonBackground)
5858
setBackgroundImage(normalBackgroundImage, for: .normal)
5959

6060
let highlightedBackgroundImage = UIImage.renderBackgroundImage(fill: .secondaryButtonDownBackground,
6161
border: .secondaryButtonDownBorder)
62-
.applyTintColorToiOS13(.secondaryButtonDownBackground)
62+
.withTintColor(.secondaryButtonDownBackground)
6363
setBackgroundImage(highlightedBackgroundImage, for: .highlighted)
6464

6565
let disabledBackgroundImage = UIImage.renderBackgroundImage(fill: .buttonDisabledBackground,
6666
border: .buttonDisabledBorder)
67-
.applyTintColorToiOS13(.buttonDisabledBackground)
67+
.withTintColor(.buttonDisabledBackground)
6868
setBackgroundImage(disabledBackgroundImage, for: .disabled)
6969
}
7070

@@ -110,25 +110,25 @@ extension UIButton {
110110

111111
let normalBackgroundImage = UIImage.renderBackgroundImage(fill: .tertiarySystemBackground,
112112
border: .secondaryButtonBorder)
113-
.applyTintColorToiOS13(.tertiarySystemBackground)
113+
.withTintColor(.tertiarySystemBackground)
114114
setBackgroundImage(normalBackgroundImage, for: .normal)
115115

116116
let highlightedBackgroundImage = UIImage.renderBackgroundImage(fill: .secondaryButtonDownBackground,
117117
border: .secondaryButtonDownBorder)
118-
.applyTintColorToiOS13(.secondaryButtonDownBackground)
118+
.withTintColor(.secondaryButtonDownBackground)
119119
setBackgroundImage(highlightedBackgroundImage, for: .highlighted)
120120

121121
let disabledBackgroundImage = UIImage.renderBackgroundImage(fill: .buttonDisabledBackground,
122122
border: .buttonDisabledBorder)
123-
.applyTintColorToiOS13(.buttonDisabledBackground)
123+
.withTintColor(.buttonDisabledBackground)
124124
setBackgroundImage(disabledBackgroundImage, for: .disabled)
125125
}
126126

127127
/// Applies the Single-Color Icon Button Style: accent/accent dark tint color
128128
///
129129
func applyIconButtonStyle(icon: UIImage) {
130-
let normalImage = icon.applyTintColor(.accent)
131-
let highlightedImage = icon.applyTintColor(.accentDark)
130+
let normalImage = icon.withTintColor(.accent)
131+
let highlightedImage = icon.withTintColor(.accentDark)
132132
setImage(normalImage, for: .normal)
133133
setImage(highlightedImage, for: .highlighted)
134134
tintColor = .accent

WooCommerce/Classes/Extensions/UIImage+TintColor.swift

Lines changed: 0 additions & 16 deletions
This file was deleted.

WooCommerce/Classes/Extensions/UIImage+Woo.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extension UIImage {
6767
static var cameraImage: UIImage {
6868
return UIImage.gridicon(.camera)
6969
.imageFlippedForRightToLeftLayoutDirection()
70-
.applyTintColor(.placeholderImage)!
70+
.withTintColor(.placeholderImage)
7171
}
7272

7373
/// Product categories Icon
@@ -329,7 +329,7 @@ extension UIImage {
329329
static var giftWithTopRightRedDotImage: UIImage {
330330
guard let image = UIImage.gridicon(.gift, size: CGSize(width: 24, height: 24))
331331
// Applies a constant gray color that looks fine in both Light/Dark modes, since we are generating an image with multiple colors.
332-
.applyTintColor(.gray(.shade30))?
332+
.withTintColor(.gray(.shade30))
333333
.imageWithTopRightDot(imageOrigin: CGPoint(x: 0, y: 2),
334334
finalSize: CGSize(width: 26, height: 26)) else {
335335
fatalError()

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
0236BCA425087B660043EB43 /* ProductFormRemoteActionUseCaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0236BCA325087B660043EB43 /* ProductFormRemoteActionUseCaseTests.swift */; };
137137
023930612918F36400B2632F /* DomainSelectorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 023930602918F36400B2632F /* DomainSelectorView.swift */; };
138138
02393069291A065000B2632F /* DomainRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02393068291A065000B2632F /* DomainRowView.swift */; };
139-
02396251239948470096F34C /* UIImage+TintColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02396250239948470096F34C /* UIImage+TintColor.swift */; };
140139
023A059A24135F2600E3FC99 /* ReviewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 023A059824135F2600E3FC99 /* ReviewsViewController.swift */; };
141140
023A059B24135F2600E3FC99 /* ReviewsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 023A059924135F2600E3FC99 /* ReviewsViewController.xib */; };
142141
023D1DD124AB2D05002B03A3 /* ProductListSelectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 023D1DD024AB2D05002B03A3 /* ProductListSelectorViewController.swift */; };
@@ -2099,7 +2098,6 @@
20992098
0236BCA325087B660043EB43 /* ProductFormRemoteActionUseCaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFormRemoteActionUseCaseTests.swift; sourceTree = "<group>"; };
21002099
023930602918F36400B2632F /* DomainSelectorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainSelectorView.swift; sourceTree = "<group>"; };
21012100
02393068291A065000B2632F /* DomainRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainRowView.swift; sourceTree = "<group>"; };
2102-
02396250239948470096F34C /* UIImage+TintColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+TintColor.swift"; sourceTree = "<group>"; };
21032101
023A059824135F2600E3FC99 /* ReviewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewsViewController.swift; sourceTree = "<group>"; };
21042102
023A059924135F2600E3FC99 /* ReviewsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReviewsViewController.xib; sourceTree = "<group>"; };
21052103
023D1DD024AB2D05002B03A3 /* ProductListSelectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductListSelectorViewController.swift; sourceTree = "<group>"; };
@@ -7814,7 +7812,6 @@
78147812
039D948E276113490044EF38 /* UIView+SuperviewConstraints.swift */,
78157813
D88CA757237D1C27005D2F44 /* Ghost+Woo.swift */,
78167814
02784A02238B8BC800BDD6A8 /* UIView+Border.swift */,
7817-
02396250239948470096F34C /* UIImage+TintColor.swift */,
78187815
F997174323DC065900592D8E /* XLPagerStrip+AccessibilityIdentifier.swift */,
78197816
0215320A24231D5A003F2BBD /* UIStackView+Subviews.swift */,
78207817
029BFD4E24597D4B00FDDEEC /* UIButton+TitleAndImage.swift */,
@@ -10381,7 +10378,6 @@
1038110378
45D1CF4723BAC89A00945A36 /* ProductTaxStatusListSelectorCommand.swift in Sources */,
1038210379
453DBF9023882814006762A5 /* ProductImagesFlowLayout.swift in Sources */,
1038310380
024DF30E23742A70006658FE /* AztecBoldFormatBarCommand.swift in Sources */,
10384-
02396251239948470096F34C /* UIImage+TintColor.swift in Sources */,
1038510381
DEE6437826D8DAD900888A75 /* InProgressView.swift in Sources */,
1038610382
0290E275238E4F8100B5C466 /* PaginatedListSelectorViewController.swift in Sources */,
1038710383
B958A7D628B5310100823EEF /* URLOpener.swift in Sources */,

0 commit comments

Comments
 (0)