refactored out VDS from naming conventions

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-08-03 13:56:14 -05:00
parent da517ee9f8
commit ffe3641500
12 changed files with 98 additions and 107 deletions

View File

@ -13,17 +13,17 @@
EA33617D288B19210071C351 /* VDS.h in Headers */ = {isa = PBXBuildFile; fileRef = EA33616F288B19200071C351 /* VDS.h */; settings = {ATTRIBUTES = (Public, ); }; };
EA336195288B1C420071C351 /* VDSColorTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA33618E288B1C0C0071C351 /* VDSColorTokens.xcframework */; };
EA336197288B1C420071C351 /* VDSFormControlsTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA33618F288B1C0C0071C351 /* VDSFormControlsTokens.xcframework */; };
EA3361A2288B1E840071C351 /* VDSToggleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361A1288B1E840071C351 /* VDSToggleModel.swift */; };
EA3361A2288B1E840071C351 /* ToggleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361A1288B1E840071C351 /* ToggleModel.swift */; };
EA3361A8288B23300071C351 /* UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361A7288B23300071C351 /* UIColor.swift */; };
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 /* VDSControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361B5288B2A410071C351 /* VDSControl.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 */; };
EA3361BF288B2EA60071C351 /* ModelHandlerable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361BE288B2EA60071C351 /* ModelHandlerable.swift */; };
EA3361C328902D960071C351 /* VDSToggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361C228902D960071C351 /* VDSToggle.swift */; };
EA3361C328902D960071C351 /* Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361C228902D960071C351 /* Toggle.swift */; };
EA3361C5289030FC0071C351 /* Accessable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361C4289030FC0071C351 /* Accessable.swift */; };
EA3361C9289054C50071C351 /* Surfaceable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361C8289054C50071C351 /* Surfaceable.swift */; };
EA3361F42891D5290071C351 /* VDSTypographyTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3361F32891D5290071C351 /* VDSTypographyTokens.xcframework */; };
@ -36,16 +36,17 @@
EA3362302891EB4A0071C351 /* VDSFonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33622F2891EB4A0071C351 /* VDSFonts.swift */; };
EA3362322891F2ED0071C351 /* VDSFontStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3362312891F2ED0071C351 /* VDSFontStyles.swift */; };
EA33623E2892EE950071C351 /* UIDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33623D2892EE950071C351 /* UIDevice.swift */; };
EA3362402892EF6C0071C351 /* VDSLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33623F2892EF6B0071C351 /* VDSLabel.swift */; };
EA3362432892EFF20071C351 /* VDSLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3362422892EFF20071C351 /* VDSLabelModel.swift */; };
EA3362402892EF6C0071C351 /* Label.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33623F2892EF6B0071C351 /* Label.swift */; };
EA3362432892EFF20071C351 /* LabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3362422892EFF20071C351 /* LabelModel.swift */; };
EA3362452892F9130071C351 /* Labelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3362442892F9130071C351 /* Labelable.swift */; };
EA33624728931B050071C351 /* Initable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33624628931B050071C351 /* Initable.swift */; };
EA3C3B4C2894823E000CA526 /* AnyProxy-PropertyWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3C3B4B2894823E000CA526 /* AnyProxy-PropertyWrapper.swift */; };
EAF7F0952899861000B287F5 /* VDSCheckbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0932899861000B287F5 /* VDSCheckbox.swift */; };
EAF7F0962899861000B287F5 /* VDSCheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0942899861000B287F5 /* VDSCheckboxModel.swift */; };
EAF7F0952899861000B287F5 /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0932899861000B287F5 /* Checkbox.swift */; };
EAF7F0962899861000B287F5 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0942899861000B287F5 /* CheckboxModel.swift */; };
EAF7F09A2899B17200B287F5 /* CATransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0992899B17200B287F5 /* CATransaction.swift */; };
EAF7F09E289AAEC000B287F5 /* VDSConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F09D289AAEC000B287F5 /* VDSConstants.swift */; };
EAF7F0A0289AB7EC00B287F5 /* VDSView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F09F289AB7EC00B287F5 /* VDSView.swift */; };
EAF7F09E289AAEC000B287F5 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F09D289AAEC000B287F5 /* Constants.swift */; };
EAF7F0A0289AB7EC00B287F5 /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F09F289AB7EC00B287F5 /* View.swift */; };
EAF7F0A2289AFB3900B287F5 /* Errorable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0A1289AFB3900B287F5 /* Errorable.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -66,17 +67,17 @@
EA33617B288B19210071C351 /* VDSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSTests.swift; sourceTree = "<group>"; };
EA33618E288B1C0C0071C351 /* VDSColorTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSColorTokens.xcframework; path = "/Users/mattbruce/Documents/Projects/iPhone/Frameworks/MVA-JSONCreator/JSONCreator_iOS/../SharedFrameworks/VDSColorTokens.xcframework"; sourceTree = "<absolute>"; };
EA33618F288B1C0C0071C351 /* VDSFormControlsTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSFormControlsTokens.xcframework; path = "/Users/mattbruce/Documents/Projects/iPhone/Frameworks/MVA-JSONCreator/JSONCreator_iOS/../SharedFrameworks/VDSFormControlsTokens.xcframework"; sourceTree = "<absolute>"; };
EA3361A1288B1E840071C351 /* VDSToggleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSToggleModel.swift; sourceTree = "<group>"; };
EA3361A1288B1E840071C351 /* ToggleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleModel.swift; sourceTree = "<group>"; };
EA3361A7288B23300071C351 /* UIColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = "<group>"; };
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 /* VDSControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSControl.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>"; };
EA3361BE288B2EA60071C351 /* ModelHandlerable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelHandlerable.swift; sourceTree = "<group>"; };
EA3361C228902D960071C351 /* VDSToggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSToggle.swift; sourceTree = "<group>"; };
EA3361C228902D960071C351 /* Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toggle.swift; sourceTree = "<group>"; };
EA3361C4289030FC0071C351 /* Accessable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Accessable.swift; sourceTree = "<group>"; };
EA3361C8289054C50071C351 /* Surfaceable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Surfaceable.swift; sourceTree = "<group>"; };
EA3361F32891D5290071C351 /* VDSTypographyTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSTypographyTokens.xcframework; path = ../SharedFrameworks/VDSTypographyTokens.xcframework; sourceTree = "<group>"; };
@ -89,16 +90,17 @@
EA33622F2891EB4A0071C351 /* VDSFonts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSFonts.swift; sourceTree = "<group>"; };
EA3362312891F2ED0071C351 /* VDSFontStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSFontStyles.swift; sourceTree = "<group>"; };
EA33623D2892EE950071C351 /* UIDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIDevice.swift; sourceTree = "<group>"; };
EA33623F2892EF6B0071C351 /* VDSLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSLabel.swift; sourceTree = "<group>"; };
EA3362422892EFF20071C351 /* VDSLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSLabelModel.swift; sourceTree = "<group>"; };
EA33623F2892EF6B0071C351 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = "<group>"; };
EA3362422892EFF20071C351 /* LabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelModel.swift; sourceTree = "<group>"; };
EA3362442892F9130071C351 /* Labelable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Labelable.swift; sourceTree = "<group>"; };
EA33624628931B050071C351 /* Initable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Initable.swift; sourceTree = "<group>"; };
EA3C3B4B2894823E000CA526 /* AnyProxy-PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AnyProxy-PropertyWrapper.swift"; sourceTree = "<group>"; };
EAF7F0932899861000B287F5 /* VDSCheckbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VDSCheckbox.swift; sourceTree = "<group>"; };
EAF7F0942899861000B287F5 /* VDSCheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VDSCheckboxModel.swift; sourceTree = "<group>"; };
EAF7F0932899861000B287F5 /* Checkbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = "<group>"; };
EAF7F0942899861000B287F5 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = "<group>"; };
EAF7F0992899B17200B287F5 /* CATransaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CATransaction.swift; sourceTree = "<group>"; };
EAF7F09D289AAEC000B287F5 /* VDSConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSConstants.swift; sourceTree = "<group>"; };
EAF7F09F289AB7EC00B287F5 /* VDSView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSView.swift; sourceTree = "<group>"; };
EAF7F09D289AAEC000B287F5 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
EAF7F09F289AB7EC00B287F5 /* View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.swift; sourceTree = "<group>"; };
EAF7F0A1289AFB3900B287F5 /* Errorable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errorable.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -189,8 +191,8 @@
EA3361A0288B1E6F0071C351 /* Toggle */ = {
isa = PBXGroup;
children = (
EA3361C228902D960071C351 /* VDSToggle.swift */,
EA3361A1288B1E840071C351 /* VDSToggleModel.swift */,
EA3361C228902D960071C351 /* Toggle.swift */,
EA3361A1288B1E840071C351 /* ToggleModel.swift */,
);
path = Toggle;
sourceTree = "<group>";
@ -198,10 +200,10 @@
EA3361A6288B23240071C351 /* Extensions */ = {
isa = PBXGroup;
children = (
EA3361A7288B23300071C351 /* UIColor.swift */,
EA33622D2891EA3C0071C351 /* DispatchQueue+Once.swift */,
EA33623D2892EE950071C351 /* UIDevice.swift */,
EAF7F0992899B17200B287F5 /* CATransaction.swift */,
EA33622D2891EA3C0071C351 /* DispatchQueue+Once.swift */,
EA3361A7288B23300071C351 /* UIColor.swift */,
EA33623D2892EE950071C351 /* UIDevice.swift */,
);
path = Extensions;
sourceTree = "<group>";
@ -213,6 +215,7 @@
EA3361B2288B265D0071C351 /* Changable.swift */,
EA3361AC288B26190071C351 /* DataTrackable.swift */,
EA3361A9288B25E40071C351 /* Disabling.swift */,
EAF7F0A1289AFB3900B287F5 /* Errorable.swift */,
EA3361AE288B26310071C351 /* FormFieldable.swift */,
EA33624628931B050071C351 /* Initable.swift */,
EA3362442892F9130071C351 /* Labelable.swift */,
@ -227,9 +230,9 @@
isa = PBXGroup;
children = (
EA3C3B4B2894823E000CA526 /* AnyProxy-PropertyWrapper.swift */,
EAF7F09D289AAEC000B287F5 /* VDSConstants.swift */,
EA3361B5288B2A410071C351 /* VDSControl.swift */,
EAF7F09F289AB7EC00B287F5 /* VDSView.swift */,
EAF7F09D289AAEC000B287F5 /* Constants.swift */,
EA3361B5288B2A410071C351 /* Control.swift */,
EAF7F09F289AB7EC00B287F5 /* View.swift */,
);
path = Classes;
sourceTree = "<group>";
@ -274,8 +277,8 @@
EA3362412892EF700071C351 /* Label */ = {
isa = PBXGroup;
children = (
EA33623F2892EF6B0071C351 /* VDSLabel.swift */,
EA3362422892EFF20071C351 /* VDSLabelModel.swift */,
EA33623F2892EF6B0071C351 /* Label.swift */,
EA3362422892EFF20071C351 /* LabelModel.swift */,
);
path = Label;
sourceTree = "<group>";
@ -283,8 +286,8 @@
EAF7F092289985E200B287F5 /* Checkbox */ = {
isa = PBXGroup;
children = (
EAF7F0932899861000B287F5 /* VDSCheckbox.swift */,
EAF7F0942899861000B287F5 /* VDSCheckboxModel.swift */,
EAF7F0932899861000B287F5 /* Checkbox.swift */,
EAF7F0942899861000B287F5 /* CheckboxModel.swift */,
);
path = Checkbox;
sourceTree = "<group>";
@ -403,27 +406,28 @@
buildActionMask = 2147483647;
files = (
EA3362322891F2ED0071C351 /* VDSFontStyles.swift in Sources */,
EA3361C328902D960071C351 /* VDSToggle.swift in Sources */,
EAF7F0A0289AB7EC00B287F5 /* VDSView.swift in Sources */,
EA3362402892EF6C0071C351 /* VDSLabel.swift in Sources */,
EA3361C328902D960071C351 /* Toggle.swift in Sources */,
EAF7F0A0289AB7EC00B287F5 /* View.swift in Sources */,
EA3362402892EF6C0071C351 /* Label.swift in Sources */,
EA33622E2891EA3C0071C351 /* DispatchQueue+Once.swift in Sources */,
EA3361C5289030FC0071C351 /* Accessable.swift in Sources */,
EA33622C2891E73B0071C351 /* FontProtocol.swift in Sources */,
EAF7F0952899861000B287F5 /* VDSCheckbox.swift in Sources */,
EAF7F0952899861000B287F5 /* Checkbox.swift in Sources */,
EA3361C9289054C50071C351 /* Surfaceable.swift in Sources */,
EA3361A2288B1E840071C351 /* VDSToggleModel.swift in Sources */,
EA3362432892EFF20071C351 /* VDSLabelModel.swift in Sources */,
EA3361A2288B1E840071C351 /* ToggleModel.swift in Sources */,
EA3362432892EFF20071C351 /* LabelModel.swift in Sources */,
EA33624728931B050071C351 /* Initable.swift in Sources */,
EA3361BD288B2C760071C351 /* TypeAlias.swift in Sources */,
EAF7F09A2899B17200B287F5 /* CATransaction.swift in Sources */,
EAF7F0A2289AFB3900B287F5 /* Errorable.swift in Sources */,
EA3C3B4C2894823E000CA526 /* AnyProxy-PropertyWrapper.swift in Sources */,
EA3361AF288B26310071C351 /* FormFieldable.swift in Sources */,
EAF7F09E289AAEC000B287F5 /* VDSConstants.swift in Sources */,
EAF7F09E289AAEC000B287F5 /* Constants.swift in Sources */,
EA3361B3288B265D0071C351 /* Changable.swift in Sources */,
EA336171288B19200071C351 /* VDS.docc in Sources */,
EAF7F0962899861000B287F5 /* VDSCheckboxModel.swift in Sources */,
EAF7F0962899861000B287F5 /* CheckboxModel.swift in Sources */,
EA3361AA288B25E40071C351 /* Disabling.swift in Sources */,
EA3361B6288B2A410071C351 /* VDSControl.swift in Sources */,
EA3361B6288B2A410071C351 /* Control.swift in Sources */,
EA3362452892F9130071C351 /* Labelable.swift in Sources */,
EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */,
EA33623E2892EE950071C351 /* UIDevice.swift in Sources */,
@ -600,6 +604,7 @@
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
@ -632,6 +637,7 @@
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_INSTALL_OBJC_HEADER = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};

View File

@ -7,12 +7,13 @@
import Foundation
public struct Constants {
public static let ModelStateDebounce = 0.02
public static let PaddingOne = 10.0
}
public func updated <T> (_ value: T, with update: (inout T) -> Void) -> T {
var editable = value
update(&editable)
return editable
}
public struct VDSConstants {
public static let ModelStateDebounce = 0.02
}

View File

@ -10,7 +10,7 @@ import UIKit
import Combine
open class VDSControl<ModelType: Initable>: UIControl, ModelHandlerable, ViewProtocol {
open class Control<ModelType: Initable>: UIControl, ModelHandlerable, ViewProtocol {
@Published public var model: ModelType
private var cancellable: AnyCancellable?
@ -52,7 +52,7 @@ open class VDSControl<ModelType: Initable>: UIControl, ModelHandlerable, ViewPro
public func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
cancellable = $model.debounce(for: .seconds(VDSConstants.ModelStateDebounce), scheduler: RunLoop.main).sink { [weak self] viewModel in
cancellable = $model.debounce(for: .seconds(Constants.ModelStateDebounce), scheduler: RunLoop.main).sink { [weak self] viewModel in
self?.onStateChange(viewModel: viewModel)
}
setup()

View File

@ -10,7 +10,7 @@ import UIKit
import Combine
open class VDSView<ModelType: Initable>: UIView, ModelHandlerable, ViewProtocol {
open class View<ModelType: Initable>: UIView, ModelHandlerable, ViewProtocol {
@Published public var model: ModelType
private var cancellable: AnyCancellable?
@ -52,7 +52,7 @@ open class VDSView<ModelType: Initable>: UIView, ModelHandlerable, ViewProtocol
public func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
cancellable = $model.debounce(for: .seconds(VDSConstants.ModelStateDebounce), scheduler: RunLoop.main).sink { [weak self] viewModel in
cancellable = $model.debounce(for: .seconds(Constants.ModelStateDebounce), scheduler: RunLoop.main).sink { [weak self] viewModel in
self?.onStateChange(viewModel: viewModel)
}
setup()

View File

@ -19,9 +19,9 @@ import Combine
Knob: The circular indicator that slides on the container.
*/
public class VDSCheckbox: VDSCheckboxBase<DefaultCheckboxModel>{}
public class Checkbox: CheckboxBase<DefaultCheckboxModel>{}
open class VDSCheckboxBase<ModelType: VDSCheckboxModel>: VDSControl<ModelType>, Changable {
open class CheckboxBase<ModelType: CheckboxModel>: Control<ModelType>, Changable {
//--------------------------------------------------
// MARK: - Private Properties
@ -49,20 +49,20 @@ open class VDSCheckboxBase<ModelType: VDSCheckboxModel>: VDSControl<ModelType>,
return stackView
}()
private var primaryLabel: VDSLabel = {
let label = VDSLabel()
private var primaryLabel: Label = {
let label = Label()
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
private var secondaryLabel: VDSLabel = {
let label = VDSLabel()
private var secondaryLabel: Label = {
let label = Label()
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
private var errorLabel: VDSLabel = {
let label = VDSLabel()
private var errorLabel: Label = {
let label = Label()
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
@ -188,7 +188,7 @@ open class VDSCheckboxBase<ModelType: VDSCheckboxModel>: VDSControl<ModelType>,
open override func setup() {
super.setup()
self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(VDSCheckbox.toggleAndAction)))
self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(Checkbox.toggleAndAction)))
isAccessibilityElement = true
accessibilityTraits = .button

View File

@ -8,19 +8,14 @@
import Foundation
import UIKit
public protocol Errorable {
var showError: Bool { get set }
var errorText: String? { get set }
}
public protocol VDSCheckboxModel: FormFieldable, Errorable, DataTrackable, Accessable, Surfaceable, Disabling, Initable {
public protocol CheckboxModel: FormFieldable, Errorable, DataTrackable, Accessable, Surfaceable, Disabling, Initable {
var id: String? { get set }
var on: Bool { get set }
var labelText: String? { get set }
var childText: String? { get set }
}
extension VDSCheckboxModel {
extension CheckboxModel {
public var fontCategory: VDSFontCategory {
get { return .body }
set { return }
@ -36,7 +31,7 @@ extension VDSCheckboxModel {
return true
}
public var labelModel: VDSLabelModel? {
public var labelModel: LabelModel? {
guard let labelText = labelText else { return nil }
let model = DefaultLabelModel()
model.fontSize = .large
@ -49,7 +44,7 @@ extension VDSCheckboxModel {
return model
}
public var childModel: VDSLabelModel? {
public var childModel: LabelModel? {
guard let childText = childText else { return nil }
let model = DefaultLabelModel()
model.fontSize = .large
@ -62,7 +57,7 @@ extension VDSCheckboxModel {
return model
}
public var errorModel: VDSLabelModel? {
public var errorModel: LabelModel? {
guard let errorText = errorText, showError else { return nil }
let model = DefaultLabelModel()
model.fontSize = .medium
@ -76,7 +71,7 @@ extension VDSCheckboxModel {
}
}
public struct DefaultCheckboxModel: VDSCheckboxModel {
public struct DefaultCheckboxModel: CheckboxModel {
public var id: String?
public var on: Bool = false

View File

@ -10,9 +10,9 @@ import UIKit
import VDSColorTokens
import Combine
open class VDSLabel: UILabel, ModelHandlerable, Initable {
open class Label: UILabel, ModelHandlerable, Initable {
@Published public var model: VDSLabelModel = DefaultLabelModel()
@Published public var model: LabelModel = DefaultLabelModel()
private var cancellable: AnyCancellable?
@Proxy(\.model.fontSize)
@ -35,7 +35,7 @@ open class VDSLabel: UILabel, ModelHandlerable, Initable {
self.init(frame: .zero)
}
public required convenience init(with model: VDSLabelModel) {
public required convenience init(with model: LabelModel) {
self.init()
self.model = model
set(with: model)
@ -52,7 +52,7 @@ open class VDSLabel: UILabel, ModelHandlerable, Initable {
}
private func setup() {
cancellable = $model.debounce(for: .seconds(VDSConstants.ModelStateDebounce), scheduler: RunLoop.main).sink { [weak self] viewModel in
cancellable = $model.debounce(for: .seconds(Constants.ModelStateDebounce), scheduler: RunLoop.main).sink { [weak self] viewModel in
self?.onStateChange(viewModel: viewModel)
}
}
@ -74,7 +74,7 @@ open class VDSLabel: UILabel, ModelHandlerable, Initable {
}
//functions
private func onStateChange(viewModel: VDSLabelModel) {
private func onStateChange(viewModel: LabelModel) {
text = viewModel.text
textAlignment = viewModel.textPosition.textAlignment
textColor = getTextColor(for: viewModel.disabled, surface: viewModel.surface)
@ -87,7 +87,7 @@ open class VDSLabel: UILabel, ModelHandlerable, Initable {
}
//Modelable
public func set(with model: VDSLabelModel) {
public func set(with model: LabelModel) {
self.model = model
}
}

View File

@ -8,11 +8,11 @@
import Foundation
import UIKit
public protocol VDSLabelModel: Labelable, Surfaceable, Disabling {
public protocol LabelModel: Labelable, Surfaceable, Disabling {
var text: String? { get set }
}
open class DefaultLabelModel: VDSLabelModel {
open class DefaultLabelModel: LabelModel {
public var text: String?
public var fontCategory: VDSFontCategory = .body
public var fontSize: VDSFontSize = .small

View File

@ -18,9 +18,9 @@ import Combine
Knob: The circular indicator that slides on the container.
*/
public class VDSToggle: VDSToggleBase<DefaultToggleModel>{}
public class Toggle: ToggleBase<DefaultToggleModel>{}
open class VDSToggleBase<ModelType: VDSToggleModel>: VDSControl<ModelType>, Changable {
open class ToggleBase<ModelType: ToggleModel>: Control<ModelType>, Changable {
//--------------------------------------------------
// MARK: - Private Properties
@ -33,8 +33,8 @@ open class VDSToggleBase<ModelType: VDSToggleModel>: VDSControl<ModelType>, Chan
return stackView
}()
private var label: VDSLabel = {
let label = VDSLabel()
private var label: Label = {
let label = Label()
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()

View File

@ -8,13 +8,7 @@
import Foundation
import UIKit
extension VDSToggle {
public enum TextPosition: String, Codable {
case left, right
}
}
public protocol VDSToggleModel: FormFieldable, DataTrackable, Accessable, Initable, Labelable, Surfaceable, Disabling {
public protocol ToggleModel: FormFieldable, DataTrackable, Accessable, Initable, Labelable, Surfaceable, Disabling {
var id: String? { get set }
var showText: Bool { get set }
var on: Bool { get set }
@ -22,13 +16,13 @@ public protocol VDSToggleModel: FormFieldable, DataTrackable, Accessable, Initab
var onText: String { get set }
}
extension VDSToggleModel {
extension ToggleModel {
public var fontCategory: VDSFontCategory {
get { return .body }
set { return }
}
public var label: VDSLabelModel {
public var label: LabelModel {
let model = DefaultLabelModel()
model.fontSize = fontSize
model.textPosition = textPosition
@ -41,7 +35,7 @@ extension VDSToggleModel {
}
}
public struct DefaultToggleModel: VDSToggleModel {
public struct DefaultToggleModel: ToggleModel {
public var id: String?
public var on: Bool = false
public var showText: Bool = false

View File

@ -0,0 +1,13 @@
//
// Errorable.swift
// VDS
//
// Created by Matt Bruce on 8/3/22.
//
import Foundation
public protocol Errorable {
var showError: Bool { get set }
var errorText: String? { get set }
}

View File

@ -10,22 +10,4 @@ import UIKit
public struct Blocks {
public typealias ActionBlock = () -> ()
public typealias StringValueBlock = (_ key: String) -> (String)
public typealias SizeForDeviceTypeBlock = (_ size: CGFloat, _ deviceType: Enums.SizeDeviceType, _ deviceSize: CGFloat) -> (CGFloat)
}
public struct Constants {
public static let PaddingOne = 10.0
}
public struct Enums {
public enum SizeDeviceType {
case iPhone4Height
case iPhone5Height
case iPhone
case largeiPhone
case iPadPortrait
case iPadLandscape
case iPadProLandscape
}
}