Skip to content

Commit c5b0e84

Browse files
committed
Remove not needed functions.
1 parent a87c25e commit c5b0e84

File tree

4 files changed

+15
-35
lines changed

4 files changed

+15
-35
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: 2 additions & 6 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 */; };
@@ -463,8 +462,8 @@
463462
035C6DEB273EA12D00F70406 /* SoftwareUpdateTypeProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035C6DEA273EA12D00F70406 /* SoftwareUpdateTypeProperty.swift */; };
464463
035F2308275690970019E1B0 /* CardPresentModalConnectingFailedUpdatePostalCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035F2307275690970019E1B0 /* CardPresentModalConnectingFailedUpdatePostalCode.swift */; };
465464
0366EAE12909A37800B51755 /* JustInTimeMessageAnnouncementCardViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0366EAE02909A37800B51755 /* JustInTimeMessageAnnouncementCardViewModel.swift */; };
466-
036CA6F129229C9E00E4DF4F /* IndefiniteCircularProgressViewStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036CA6F029229C9E00E4DF4F /* IndefiniteCircularProgressViewStyle.swift */; };
467465
036CA6B9291E8D4B00E4DF4F /* CardPresentModalPreparingReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036CA6B8291E8D4B00E4DF4F /* CardPresentModalPreparingReader.swift */; };
466+
036CA6F129229C9E00E4DF4F /* IndefiniteCircularProgressViewStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036CA6F029229C9E00E4DF4F /* IndefiniteCircularProgressViewStyle.swift */; };
468467
036F6EA6281847D5006D84F8 /* PaymentCaptureOrchestratorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036F6EA5281847D5006D84F8 /* PaymentCaptureOrchestratorTests.swift */; };
469468
0371C3682875E47B00277E2C /* FeatureAnnouncementCardViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0371C3672875E47B00277E2C /* FeatureAnnouncementCardViewModel.swift */; };
470469
0371C36A2876DBCA00277E2C /* FeatureAnnouncementCardViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0371C3692876DBCA00277E2C /* FeatureAnnouncementCardViewModelTests.swift */; };
@@ -2103,7 +2102,6 @@
21032102
0236BCA325087B660043EB43 /* ProductFormRemoteActionUseCaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFormRemoteActionUseCaseTests.swift; sourceTree = "<group>"; };
21042103
023930602918F36400B2632F /* DomainSelectorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainSelectorView.swift; sourceTree = "<group>"; };
21052104
02393068291A065000B2632F /* DomainRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainRowView.swift; sourceTree = "<group>"; };
2106-
02396250239948470096F34C /* UIImage+TintColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+TintColor.swift"; sourceTree = "<group>"; };
21072105
023A059824135F2600E3FC99 /* ReviewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewsViewController.swift; sourceTree = "<group>"; };
21082106
023A059924135F2600E3FC99 /* ReviewsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReviewsViewController.xib; sourceTree = "<group>"; };
21092107
023D1DD024AB2D05002B03A3 /* ProductListSelectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductListSelectorViewController.swift; sourceTree = "<group>"; };
@@ -2433,8 +2431,8 @@
24332431
035C6DEA273EA12D00F70406 /* SoftwareUpdateTypeProperty.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoftwareUpdateTypeProperty.swift; sourceTree = "<group>"; };
24342432
035F2307275690970019E1B0 /* CardPresentModalConnectingFailedUpdatePostalCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardPresentModalConnectingFailedUpdatePostalCode.swift; sourceTree = "<group>"; };
24352433
0366EAE02909A37800B51755 /* JustInTimeMessageAnnouncementCardViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JustInTimeMessageAnnouncementCardViewModel.swift; sourceTree = "<group>"; };
2436-
036CA6F029229C9E00E4DF4F /* IndefiniteCircularProgressViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndefiniteCircularProgressViewStyle.swift; sourceTree = "<group>"; };
24372434
036CA6B8291E8D4B00E4DF4F /* CardPresentModalPreparingReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardPresentModalPreparingReader.swift; sourceTree = "<group>"; };
2435+
036CA6F029229C9E00E4DF4F /* IndefiniteCircularProgressViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndefiniteCircularProgressViewStyle.swift; sourceTree = "<group>"; };
24382436
036F6EA5281847D5006D84F8 /* PaymentCaptureOrchestratorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentCaptureOrchestratorTests.swift; sourceTree = "<group>"; };
24392437
0371C3672875E47B00277E2C /* FeatureAnnouncementCardViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureAnnouncementCardViewModel.swift; sourceTree = "<group>"; };
24402438
0371C3692876DBCA00277E2C /* FeatureAnnouncementCardViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureAnnouncementCardViewModelTests.swift; sourceTree = "<group>"; };
@@ -7827,7 +7825,6 @@
78277825
039D948E276113490044EF38 /* UIView+SuperviewConstraints.swift */,
78287826
D88CA757237D1C27005D2F44 /* Ghost+Woo.swift */,
78297827
02784A02238B8BC800BDD6A8 /* UIView+Border.swift */,
7830-
02396250239948470096F34C /* UIImage+TintColor.swift */,
78317828
F997174323DC065900592D8E /* XLPagerStrip+AccessibilityIdentifier.swift */,
78327829
0215320A24231D5A003F2BBD /* UIStackView+Subviews.swift */,
78337830
029BFD4E24597D4B00FDDEEC /* UIButton+TitleAndImage.swift */,
@@ -10395,7 +10392,6 @@
1039510392
45D1CF4723BAC89A00945A36 /* ProductTaxStatusListSelectorCommand.swift in Sources */,
1039610393
453DBF9023882814006762A5 /* ProductImagesFlowLayout.swift in Sources */,
1039710394
024DF30E23742A70006658FE /* AztecBoldFormatBarCommand.swift in Sources */,
10398-
02396251239948470096F34C /* UIImage+TintColor.swift in Sources */,
1039910395
DEE6437826D8DAD900888A75 /* InProgressView.swift in Sources */,
1040010396
0290E275238E4F8100B5C466 /* PaginatedListSelectorViewController.swift in Sources */,
1040110397
B958A7D628B5310100823EEF /* URLOpener.swift in Sources */,

0 commit comments

Comments
 (0)