From 4b9d81cd13d8cb0addaafbff61082bc3407b7148 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 4 Apr 2023 17:28:48 -0500 Subject: [PATCH] Fixes PillButton not respecting progressTintColor under certain conditions --- AltStore/Components/PillButton.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/AltStore/Components/PillButton.swift b/AltStore/Components/PillButton.swift index c94b5ca9..f32bc1a2 100644 --- a/AltStore/Components/PillButton.swift +++ b/AltStore/Components/PillButton.swift @@ -38,11 +38,8 @@ final class PillButton: UIButton } var progressTintColor: UIColor? { - get { - return self.progressView.progressTintColor - } - set { - self.progressView.progressTintColor = newValue + didSet { + self.update() } } @@ -169,7 +166,7 @@ private extension PillButton self.backgroundColor = self.tintColor.withAlphaComponent(0.15) } - self.progressView.progressTintColor = self.tintColor + self.progressView.progressTintColor = self.progressTintColor ?? self.tintColor // Update font after init because the original titleLabel is replaced. self.titleLabel?.font = UIFont.boldSystemFont(ofSize: 14)