added back isEnabled override

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-07-14 14:42:56 -05:00
parent 02996e51e5
commit c9180e9c36
2 changed files with 20 additions and 12 deletions

View File

@ -84,18 +84,16 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab
}
}
// /// Override to deal with setNeedsUpdate()
// open override var isEnabled: Bool {
// get { !disabled }
// set {
// if disabled != !newValue {
// disabled = !newValue
// }
// isUserInteractionEnabled = isEnabled
// setNeedsUpdate()
// }
// }
//
/// Override to deal with setNeedsUpdate()
open override var isEnabled: Bool {
get { !disabled }
set {
if disabled != !newValue {
disabled = !newValue
}
}
}
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------

View File

@ -80,6 +80,16 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
}
}
/// Override to deal with setNeedsUpdate()
open override var isEnabled: Bool {
get { !disabled }
set {
if disabled != !newValue {
disabled = !newValue
}
}
}
open override var state: UIControl.State {
get {
var state = super.state