diff --git a/VDS/Components/Buttons/Button/ButtonBase.swift b/VDS/Components/Buttons/Button/ButtonBase.swift index 887fff2c..121ae8f6 100644 --- a/VDS/Components/Buttons/Button/ButtonBase.swift +++ b/VDS/Components/Buttons/Button/ButtonBase.swift @@ -43,9 +43,23 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab open var surface: Surface = .light { didSet { didChange() }} open var disabled: Bool = false { didSet { isEnabled = !disabled } } - - open override var isHighlighted: Bool { didSet { if isHighlighted != oldValue { updateView() } } } - + + var isHighlightAnimating = false + open override var isHighlighted: Bool { + didSet { + if isHighlightAnimating == false { + isHighlightAnimating = true + UIView.animate(withDuration: 0.1, animations: { [weak self] in + self?.updateView() + }) { [weak self] _ in + //you update the view since this is typically a quick change + self?.updateView() + self?.isHighlightAnimating = false + } + } + } + } + open var typograpicalStyle: TypographicalStyle { .defaultStyle } open var textColor: UIColor { .black } @@ -129,7 +143,6 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab // MARK: - PRIVATE //-------------------------------------------------- private func updateLabel() { - let font = typograpicalStyle.font //clear the arrays holding actions