deleted Changeable - onChange: ActionBlock

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-09-14 12:43:41 -05:00
parent 77a02a1e25
commit 78443263ba
9 changed files with 8 additions and 48 deletions

View File

@ -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 = "<group>"; };
EA3361AC288B26190071C351 /* DataTrackable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataTrackable.swift; sourceTree = "<group>"; };
EA3361AE288B26310071C351 /* FormFieldable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormFieldable.swift; sourceTree = "<group>"; };
EA3361B2288B265D0071C351 /* Changable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Changable.swift; sourceTree = "<group>"; };
EA3361B5288B2A410071C351 /* Control.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Control.swift; sourceTree = "<group>"; };
EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewProtocol.swift; sourceTree = "<group>"; };
EA3361BC288B2C760071C351 /* TypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeAlias.swift; sourceTree = "<group>"; };
@ -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 */,

View File

@ -8,15 +8,13 @@
import Foundation
import UIKit
public class SelectorGroupHandlerBase<GroupModelType: SelectorGroupModelable, ModelHandlerType: Control<GroupModelType.SelectorModelType>>: Control<GroupModelType>, Changable {
public class SelectorGroupHandlerBase<GroupModelType: SelectorGroupModelable, ModelHandlerType: Control<GroupModelType.SelectorModelType>>: Control<GroupModelType> {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var selectorViews: [ModelHandlerType] = []
public var onChange: Blocks.ActionBlock?
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------

View File

@ -23,7 +23,7 @@ public class SoloCheckbox: CheckboxBase<DefaultCheckboxModel>{
}
}
open class CheckboxBase<ModelType: CheckboxModel>: Control<ModelType>, Changable {
open class CheckboxBase<ModelType: CheckboxModel>: Control<ModelType> {
//--------------------------------------------------
// MARK: - Private Properties
@ -65,8 +65,6 @@ open class CheckboxBase<ModelType: CheckboxModel>: Control<ModelType>, 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<ModelType: CheckboxModel>: Control<ModelType>, 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<ModelType: CheckboxModel>: Control<ModelType>, Changable
}
isSelected.toggle()
sendActions(for: .valueChanged)
onChange?()
}
//--------------------------------------------------

View File

@ -24,7 +24,7 @@ public class SolorRadioBox: RadioBoxBase<DefaultRadioBoxModel>{
}
}
open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType>, Changable {
open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType> {
//--------------------------------------------------
// MARK: - Private Properties
@ -67,8 +67,6 @@ open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType>, 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<ModelType: RadioBoxModel>: Control<ModelType>, 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<ModelType: RadioBoxModel>: Control<ModelType>, Changable
//removed error
isSelected.toggle()
sendActions(for: .valueChanged)
onChange?()
}
//--------------------------------------------------

View File

@ -31,7 +31,7 @@ public class SoloRadioButton: RadioButtonBase<DefaultRadioButtonModel>{
}
}
open class RadioButtonBase<ModelType: RadioButtonModel>: Control<ModelType>, Changable {
open class RadioButtonBase<ModelType: RadioButtonModel>: Control<ModelType> {
//--------------------------------------------------
// MARK: - Private Properties
@ -73,8 +73,6 @@ open class RadioButtonBase<ModelType: RadioButtonModel>: Control<ModelType>, 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<ModelType: RadioButtonModel>: Control<ModelType>, 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<ModelType: RadioButtonModel>: Control<ModelType>, Cha
}
isSelected.toggle()
sendActions(for: .valueChanged)
onChange?()
}
//--------------------------------------------------

View File

@ -21,7 +21,7 @@ public class RadioSwatch: RadioSwatchBase<DefaultRadioSwatchModel>{
}
}
open class RadioSwatchBase<ModelType: RadioSwatchModel>: Control<ModelType>, Changable {
open class RadioSwatchBase<ModelType: RadioSwatchModel>: Control<ModelType> {
//--------------------------------------------------
// MARK: - Public Properties
@ -38,8 +38,6 @@ open class RadioSwatchBase<ModelType: RadioSwatchModel>: Control<ModelType>, 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<ModelType: RadioSwatchModel>: Control<ModelType>, Cha
super.reset()
updateSelector(model)
setAccessibilityLabel()
onChange = nil
}
open func toggle() {
isSelected.toggle()
sendActions(for: .valueChanged)
onChange?()
}
//--------------------------------------------------

View File

@ -23,7 +23,7 @@ public class RadioSwatchGroup: RadioSwatchGroupBase<DefaultRadioSwatchGroupModel
}
public class RadioSwatchGroupBase<GroupModelType: RadioSwatchGroupModel, ModelHandlerType: RadioSwatchBase<GroupModelType.SelectorModelType>>: Control<GroupModelType>, Changable, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate {
public class RadioSwatchGroupBase<GroupModelType: RadioSwatchGroupModel, ModelHandlerType: RadioSwatchBase<GroupModelType.SelectorModelType>>: Control<GroupModelType>, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate {
//--------------------------------------------------
// MARK: - Public Properties
@ -31,8 +31,6 @@ public class RadioSwatchGroupBase<GroupModelType: RadioSwatchGroupModel, ModelHa
public var selectedModel: ModelHandlerType.ModelType? {
return model.selectedModel
}
public var onChange: Blocks.ActionBlock?
//--------------------------------------------------
// MARK: - Private Properties

View File

@ -28,7 +28,7 @@ public class Toggle: ToggleBase<DefaultToggleModel>{
}
}
open class ToggleBase<ModelType: ToggleModel>: Control<ModelType>, Changable {
open class ToggleBase<ModelType: ToggleModel>: Control<ModelType> {
//--------------------------------------------------
// MARK: - Private Properties
@ -93,8 +93,6 @@ open class ToggleBase<ModelType: ToggleModel>: Control<ModelType>, Changable {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var onChange: Blocks.ActionBlock?
@Proxy(\.model.on)
open var isOn: Bool
@ -320,14 +318,12 @@ open class ToggleBase<ModelType: ToggleModel>: Control<ModelType>, 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?()
}
//--------------------------------------------------

View File

@ -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 }
}