Add a highlight background color

Adds an IBInspectable background color for the hightlight state.
This commit is contained in:
Jonathan Bennett 2019-10-28 00:51:13 -04:00
parent 47ca7a8a30
commit 25411ead45

View File

@ -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
}
}