From 25411ead452f2b8a6d8545e751fc7a90c0afe31f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 28 Oct 2019 00:51:13 -0400 Subject: [PATCH] Add a highlight background color Adds an IBInspectable background color for the hightlight state. --- iOS/UIKit Extensions/VibrantButton.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iOS/UIKit Extensions/VibrantButton.swift b/iOS/UIKit Extensions/VibrantButton.swift index dc311d549..51a4a7021 100644 --- a/iOS/UIKit Extensions/VibrantButton.swift +++ b/iOS/UIKit Extensions/VibrantButton.swift @@ -9,6 +9,8 @@ import UIKit class VibrantButton: UIButton { + + @IBInspectable var backgroundHighlightColor: UIColor = AppAssets.secondaryAccentColor override init(frame: CGRect) { super.init(frame: frame) @@ -25,7 +27,7 @@ class VibrantButton: UIButton { override var isHighlighted: Bool { didSet { - backgroundColor = isHighlighted ? AppAssets.secondaryAccentColor : nil + backgroundColor = isHighlighted ? backgroundHighlightColor : nil titleLabel?.alpha = 1 } }