From c9180e9c36a43ff2cb6ec868e8b2ee54c8891e80 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 14 Jul 2023 14:42:56 -0500 Subject: [PATCH] added back isEnabled override Signed-off-by: Matt Bruce --- VDS/Classes/Control.swift | 22 +++++++++---------- .../Buttons/Button/ButtonBase.swift | 10 +++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/VDS/Classes/Control.swift b/VDS/Classes/Control.swift index 2823bb80..35862574 100644 --- a/VDS/Classes/Control.swift +++ b/VDS/Classes/Control.swift @@ -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 //-------------------------------------------------- diff --git a/VDS/Components/Buttons/Button/ButtonBase.swift b/VDS/Components/Buttons/Button/ButtonBase.swift index 00eed2db..d21af3b8 100644 --- a/VDS/Components/Buttons/Button/ButtonBase.swift +++ b/VDS/Components/Buttons/Button/ButtonBase.swift @@ -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