added highlight
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
bd96705b4e
commit
89b200c005
@ -29,8 +29,24 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable {
|
||||
|
||||
open override var isSelected: Bool { didSet { didChange() } }
|
||||
|
||||
open override var isHighlighted: Bool { didSet { 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
|
||||
UIView.animate(withDuration: 0.1, animations: { [weak self] in
|
||||
self?.updateView()
|
||||
self?.isHighlightAnimating = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open override var isEnabled: Bool {
|
||||
get { !disabled }
|
||||
set {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user