From 78443263ba6d8d756ba55136833e4329a78fa37f Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 14 Sep 2022 12:43:41 -0500 Subject: [PATCH] deleted Changeable - onChange: ActionBlock Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 4 ---- VDS/Classes/SelectorGroupHandlerBase.swift | 6 ++---- VDS/Components/Checkbox/Checkbox.swift | 6 +----- VDS/Components/RadioBox/RadioBox.swift | 6 +----- VDS/Components/RadioButton/RadioButton.swift | 6 +----- VDS/Components/RadioSwatch/RadioSwatch.swift | 6 +----- VDS/Components/RadioSwatch/RadioSwatchGroup.swift | 4 +--- VDS/Components/Toggle/Toggle.swift | 6 +----- VDS/Protocols/Changable.swift | 12 ------------ 9 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 VDS/Protocols/Changable.swift diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index cc818765..19932f80 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ EA3361AA288B25E40071C351 /* Disabling.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361A9288B25E40071C351 /* Disabling.swift */; }; EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361AC288B26190071C351 /* DataTrackable.swift */; }; EA3361AF288B26310071C351 /* FormFieldable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361AE288B26310071C351 /* FormFieldable.swift */; }; - EA3361B3288B265D0071C351 /* Changable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361B2288B265D0071C351 /* Changable.swift */; }; EA3361B6288B2A410071C351 /* Control.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361B5288B2A410071C351 /* Control.swift */; }; EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */; }; EA3361BD288B2C760071C351 /* TypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361BC288B2C760071C351 /* TypeAlias.swift */; }; @@ -118,7 +117,6 @@ EA3361A9288B25E40071C351 /* Disabling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Disabling.swift; sourceTree = ""; }; EA3361AC288B26190071C351 /* DataTrackable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataTrackable.swift; sourceTree = ""; }; EA3361AE288B26310071C351 /* FormFieldable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormFieldable.swift; sourceTree = ""; }; - EA3361B2288B265D0071C351 /* Changable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Changable.swift; sourceTree = ""; }; EA3361B5288B2A410071C351 /* Control.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Control.swift; sourceTree = ""; }; EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewProtocol.swift; sourceTree = ""; }; EA3361BC288B2C760071C351 /* TypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeAlias.swift; sourceTree = ""; }; @@ -319,7 +317,6 @@ isa = PBXGroup; children = ( EA3361C4289030FC0071C351 /* Accessable.swift */, - EA3361B2288B265D0071C351 /* Changable.swift */, EA3361AC288B26190071C351 /* DataTrackable.swift */, EA3361A9288B25E40071C351 /* Disabling.swift */, EAF7F0A1289AFB3900B287F5 /* Errorable.swift */, @@ -635,7 +632,6 @@ EA89201528B56CF4006B9984 /* RadioBoxGroup.swift in Sources */, EAF7F09E289AAEC000B287F5 /* Constants.swift in Sources */, EA1F266528B945070033E859 /* RadioSwatch.swift in Sources */, - EA3361B3288B265D0071C351 /* Changable.swift in Sources */, EA4DB18528CA967F00103EE3 /* SelectorGroupHandlerBase.swift in Sources */, EA89200228AECF2A006B9984 /* UIButton+Publisher.swift in Sources */, EAF7F0AB289B13FD00B287F5 /* LabelAttributeFont.swift in Sources */, diff --git a/VDS/Classes/SelectorGroupHandlerBase.swift b/VDS/Classes/SelectorGroupHandlerBase.swift index 37abed69..d912927a 100644 --- a/VDS/Classes/SelectorGroupHandlerBase.swift +++ b/VDS/Classes/SelectorGroupHandlerBase.swift @@ -8,15 +8,13 @@ import Foundation import UIKit -public class SelectorGroupHandlerBase>: Control, Changable { +public class SelectorGroupHandlerBase>: Control { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- public var selectorViews: [ModelHandlerType] = [] - - public var onChange: Blocks.ActionBlock? - + //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- diff --git a/VDS/Components/Checkbox/Checkbox.swift b/VDS/Components/Checkbox/Checkbox.swift index 03b924bf..213f4f35 100644 --- a/VDS/Components/Checkbox/Checkbox.swift +++ b/VDS/Components/Checkbox/Checkbox.swift @@ -23,7 +23,7 @@ public class SoloCheckbox: CheckboxBase{ } } -open class CheckboxBase: Control, Changable { +open class CheckboxBase: Control { //-------------------------------------------------- // MARK: - Private Properties @@ -65,8 +65,6 @@ open class CheckboxBase: Control, Changable $0.translatesAutoresizingMaskIntoConstraints = false } }() - - public var onChange: Blocks.ActionBlock? //can't bind to @Proxy open override var isSelected: Bool { @@ -216,7 +214,6 @@ open class CheckboxBase: Control, Changable super.reset() updateSelector(model) setAccessibilityLabel() - onChange = nil } /// This will checkbox the state of the Selector and execute the actionBlock if provided. @@ -227,7 +224,6 @@ open class CheckboxBase: Control, Changable } isSelected.toggle() sendActions(for: .valueChanged) - onChange?() } //-------------------------------------------------- diff --git a/VDS/Components/RadioBox/RadioBox.swift b/VDS/Components/RadioBox/RadioBox.swift index dd58e0fb..c249ada6 100644 --- a/VDS/Components/RadioBox/RadioBox.swift +++ b/VDS/Components/RadioBox/RadioBox.swift @@ -24,7 +24,7 @@ public class SolorRadioBox: RadioBoxBase{ } } -open class RadioBoxBase: Control, Changable { +open class RadioBoxBase: Control { //-------------------------------------------------- // MARK: - Private Properties @@ -67,8 +67,6 @@ open class RadioBoxBase: Control, Changable $0.translatesAutoresizingMaskIntoConstraints = false } }() - - public var onChange: Blocks.ActionBlock? //can't bind to @Proxy open override var isSelected: Bool { @@ -196,7 +194,6 @@ open class RadioBoxBase: Control, Changable super.reset() updateSelector(model) setAccessibilityLabel() - onChange = nil } /// This will radioBox the state of the Selector and execute the actionBlock if provided. @@ -204,7 +201,6 @@ open class RadioBoxBase: Control, Changable //removed error isSelected.toggle() sendActions(for: .valueChanged) - onChange?() } //-------------------------------------------------- diff --git a/VDS/Components/RadioButton/RadioButton.swift b/VDS/Components/RadioButton/RadioButton.swift index 6e53d334..76e432f6 100644 --- a/VDS/Components/RadioButton/RadioButton.swift +++ b/VDS/Components/RadioButton/RadioButton.swift @@ -31,7 +31,7 @@ public class SoloRadioButton: RadioButtonBase{ } } -open class RadioButtonBase: Control, Changable { +open class RadioButtonBase: Control { //-------------------------------------------------- // MARK: - Private Properties @@ -73,8 +73,6 @@ open class RadioButtonBase: Control, Cha $0.translatesAutoresizingMaskIntoConstraints = false } }() - - public var onChange: Blocks.ActionBlock? //can't bind to @Proxy open override var isSelected: Bool { @@ -224,7 +222,6 @@ open class RadioButtonBase: Control, Cha super.reset() updateSelector(model) setAccessibilityLabel() - onChange = nil } /// This will checkbox the state of the Selector and execute the actionBlock if provided. @@ -237,7 +234,6 @@ open class RadioButtonBase: Control, Cha } isSelected.toggle() sendActions(for: .valueChanged) - onChange?() } //-------------------------------------------------- diff --git a/VDS/Components/RadioSwatch/RadioSwatch.swift b/VDS/Components/RadioSwatch/RadioSwatch.swift index 6cd66f90..9d7d1c35 100644 --- a/VDS/Components/RadioSwatch/RadioSwatch.swift +++ b/VDS/Components/RadioSwatch/RadioSwatch.swift @@ -21,7 +21,7 @@ public class RadioSwatch: RadioSwatchBase{ } } -open class RadioSwatchBase: Control, Changable { +open class RadioSwatchBase: Control { //-------------------------------------------------- // MARK: - Public Properties @@ -38,8 +38,6 @@ open class RadioSwatchBase: Control, Cha $0.contentMode = .scaleAspectFit } }() - - public var onChange: Blocks.ActionBlock? //can't bind to @Proxy open override var isSelected: Bool { @@ -132,13 +130,11 @@ open class RadioSwatchBase: Control, Cha super.reset() updateSelector(model) setAccessibilityLabel() - onChange = nil } open func toggle() { isSelected.toggle() sendActions(for: .valueChanged) - onChange?() } //-------------------------------------------------- diff --git a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift index 8871d170..8f193ee8 100644 --- a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift +++ b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift @@ -23,7 +23,7 @@ public class RadioSwatchGroup: RadioSwatchGroupBase>: Control, Changable, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate { +public class RadioSwatchGroupBase>: Control, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate { //-------------------------------------------------- // MARK: - Public Properties @@ -31,8 +31,6 @@ public class RadioSwatchGroupBase{ } } -open class ToggleBase: Control, Changable { +open class ToggleBase: Control { //-------------------------------------------------- // MARK: - Private Properties @@ -93,8 +93,6 @@ open class ToggleBase: Control, Changable { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var onChange: Blocks.ActionBlock? - @Proxy(\.model.on) open var isOn: Bool @@ -320,14 +318,12 @@ open class ToggleBase: Control, Changable { toggleView.backgroundColor = toggleColorConfiguration.getColor(model) knobView.backgroundColor = knobColorConfiguration.getColor(model) setAccessibilityLabel() - onChange = nil } /// This will toggle the state of the Toggle and execute the actionBlock if provided. open func toggle() { isOn.toggle() sendActions(for: .valueChanged) - onChange?() } //-------------------------------------------------- diff --git a/VDS/Protocols/Changable.swift b/VDS/Protocols/Changable.swift deleted file mode 100644 index 6df913c3..00000000 --- a/VDS/Protocols/Changable.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// Changable.swift -// VDS -// -// Created by Matt Bruce on 7/22/22. -// - -import Foundation - -public protocol Changable { - var onChange: Blocks.ActionBlock? { get set } -}