From 16150d7a8a4335a762368eda78d7ff9c6518d650 Mon Sep 17 00:00:00 2001 From: Aleksandr Gusev Date: Mon, 19 Mar 2018 15:02:54 -0400 Subject: [PATCH] Use TapActionCell's tintColor as its label textColor --- Source/View/TapActionCell.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/View/TapActionCell.swift b/Source/View/TapActionCell.swift index 3d391304..d0187ba7 100644 --- a/Source/View/TapActionCell.swift +++ b/Source/View/TapActionCell.swift @@ -29,11 +29,6 @@ import UIKit /// A `UITableViewCell` subclass with the title text center aligned. open class TapActionCell: UITableViewCell { - private static var systemTintColor: UIColor = { - let _button = UIButton() - return _button.tintColor ?? UIColor.blue - }() - // MARK: - Initializer /** @@ -61,12 +56,19 @@ open class TapActionCell: UITableViewCell { setUpAppearance() } + // MARK: UIView + + open override func tintColorDidChange() { + super.tintColorDidChange() + textLabel?.textColor = tintColor + } + // MARK: Private Methods private func setUpAppearance() { textLabel?.numberOfLines = 0 textLabel?.textAlignment = .center - textLabel?.textColor = type(of: self).systemTintColor + textLabel?.textColor = tintColor } }