diff --git a/VDS/Classes/View.swift b/VDS/Classes/View.swift index 4697f88b..e66a7448 100644 --- a/VDS/Classes/View.swift +++ b/VDS/Classes/View.swift @@ -33,16 +33,6 @@ open class View: UIView, ViewProtocol, UserInfoable { /// Current Surface and this is used to pass down to child objects that implement Surfacable open var surface: Surface = .light { didSet { setNeedsUpdate() } } - /// Whether this object is disabled or not. - open var disabled: Bool { - get { !isEnabled } - set { - if !isEnabled != newValue { - isEnabled = !newValue - } - } - } - /// Whether the View is enabled or not. open var isEnabled: Bool = true { didSet { setNeedsUpdate() } } diff --git a/VDS/Components/Buttons/Button/ButtonBase.swift b/VDS/Components/Buttons/Button/ButtonBase.swift index 58772cd4..d8c3add4 100644 --- a/VDS/Components/Buttons/Button/ButtonBase.swift +++ b/VDS/Components/Buttons/Button/ButtonBase.swift @@ -83,7 +83,7 @@ open class ButtonBase: UIButton, Buttonable, ViewProtocol, UserInfoable, Clickab } } } - + /// Whether the Control is enabled or not. open override var isEnabled: Bool { didSet { setNeedsUpdate() } } diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 56e0c0aa..c5cd4d9e 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -110,7 +110,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase { } extension CheckboxGroup { - public struct CheckboxModel : Surfaceable, Disabling, Initable, FormFieldable, Errorable { + public struct CheckboxModel : Surfaceable, Initable, FormFieldable, Errorable { /// Whether this object is disabled or not public var disabled: Bool diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index e552bb2e..45777f5b 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -54,7 +54,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable { setNeedsUpdate() } } - + /// Whether the View is enabled or not. open override var isEnabled: Bool { didSet { setNeedsUpdate() } } diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index 19bdfd61..2443bc74 100644 --- a/VDS/Components/RadioBox/RadioBoxGroup.swift +++ b/VDS/Components/RadioBox/RadioBoxGroup.swift @@ -106,7 +106,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase { } extension RadioBoxGroup { - public struct RadioBoxModel: Surfaceable, Initable, Disabling, FormFieldable { + public struct RadioBoxModel: Surfaceable, Initable, FormFieldable { /// Whether this object is disabled or not public var disabled: Bool /// Current Surface and this is used to pass down to child objects that implement Surfacable diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index 29842ad2..90e8bba7 100644 --- a/VDS/Components/RadioButton/RadioButtonGroup.swift +++ b/VDS/Components/RadioButton/RadioButtonGroup.swift @@ -114,7 +114,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase { } extension RadioButtonGroup { - public struct RadioButtonModel: Surfaceable, Disabling, Initable, FormFieldable, Errorable { + public struct RadioButtonModel: Surfaceable, Initable, FormFieldable, Errorable { /// Whether this object is disabled or not public var disabled: Bool diff --git a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift index 83789f04..98cc0d44 100644 --- a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift +++ b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift @@ -71,6 +71,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Whether this object is disabled or not override public var isEnabled: Bool { didSet { @@ -192,7 +193,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo } extension RadioSwatchGroup { - public struct RadioSwatchModel: Surfaceable, Disabling, Initable { + public struct RadioSwatchModel: Surfaceable, Initable { /// Whether this object is disabled or not public var disabled: Bool = false /// Current Surface and this is used to pass down to child objects that implement Surfacable diff --git a/VDS/Components/TextFields/EntryField/EntryField.swift b/VDS/Components/TextFields/EntryField/EntryField.swift index 426e0fa8..933d53ee 100644 --- a/VDS/Components/TextFields/EntryField/EntryField.swift +++ b/VDS/Components/TextFields/EntryField/EntryField.swift @@ -302,7 +302,6 @@ open class EntryField: Control, Changeable { titleLabel.attributes = attributes titleLabel.surface = surface titleLabel.isEnabled = isEnabled - } open func updateErrorLabel(){ diff --git a/VDS/Components/Toggle/Toggle.swift b/VDS/Components/Toggle/Toggle.swift index 61ca1b95..9f030d90 100644 --- a/VDS/Components/Toggle/Toggle.swift +++ b/VDS/Components/Toggle/Toggle.swift @@ -179,6 +179,7 @@ open class Toggle: Control, Changeable { super.reset() shouldUpdateView = false label.reset() + isEnabled = true isOn = false isAnimated = true showText = false diff --git a/VDS/Components/Tooltip/TrailingTooltipLabel.swift b/VDS/Components/Tooltip/TrailingTooltipLabel.swift index 32f255b1..0555a5a9 100644 --- a/VDS/Components/Tooltip/TrailingTooltipLabel.swift +++ b/VDS/Components/Tooltip/TrailingTooltipLabel.swift @@ -72,7 +72,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable { label.attributes = labelAttributes label.surface = surface label.isEnabled = isEnabled - + //add tooltip if let labelText, !labelText.isEmpty { label.addTooltip(model: .init(surface: surface, closeButtonText: tooltipCloseButtonText, title: tooltipTitle, content: tooltipContent, contentView: tooltipContentView)) diff --git a/VDS/Protocols/Disabling.swift b/VDS/Protocols/Disabling.swift index 51a5bb50..12b938a7 100644 --- a/VDS/Protocols/Disabling.swift +++ b/VDS/Protocols/Disabling.swift @@ -7,8 +7,8 @@ import Foundation -/// Any object that can be disabled, which may change the appearance -public protocol Disabling { - /// Whether this object is disabled or not - var disabled: Bool { get set } -} +///// Any object that can be disabled, which may change the appearance +//public protocol Disabling { +// /// Whether this object is disabled or not +// var disabled: Bool { get set } +//}