Add a highlight background color
Adds an IBInspectable background color for the hightlight state.
This commit is contained in:
parent
47ca7a8a30
commit
25411ead45
|
@ -10,6 +10,8 @@ import UIKit
|
|||
|
||||
class VibrantButton: UIButton {
|
||||
|
||||
@IBInspectable var backgroundHighlightColor: UIColor = AppAssets.secondaryAccentColor
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
commonInit()
|
||||
|
@ -25,7 +27,7 @@ class VibrantButton: UIButton {
|
|||
|
||||
override var isHighlighted: Bool {
|
||||
didSet {
|
||||
backgroundColor = isHighlighted ? AppAssets.secondaryAccentColor : nil
|
||||
backgroundColor = isHighlighted ? backgroundHighlightColor : nil
|
||||
titleLabel?.alpha = 1
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue