From ffe364150059b5f4da6c615879ed76050d631ac2 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 3 Aug 2022 13:56:14 -0500 Subject: [PATCH] refactored out VDS from naming conventions Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 84 ++++++++++--------- .../{VDSConstants.swift => Constants.swift} | 9 +- .../{VDSControl.swift => Control.swift} | 4 +- VDS/Classes/{VDSView.swift => View.swift} | 4 +- .../{VDSCheckbox.swift => Checkbox.swift} | 18 ++-- ...heckboxModel.swift => CheckboxModel.swift} | 17 ++-- .../Label/{VDSLabel.swift => Label.swift} | 12 +-- .../{VDSLabelModel.swift => LabelModel.swift} | 4 +- .../Toggle/{VDSToggle.swift => Toggle.swift} | 8 +- ...VDSToggleModel.swift => ToggleModel.swift} | 14 +--- VDS/Protocols/Errorable.swift | 13 +++ VDS/Utilities/TypeAlias.swift | 18 ---- 12 files changed, 98 insertions(+), 107 deletions(-) rename VDS/Classes/{VDSConstants.swift => Constants.swift} (81%) rename VDS/Classes/{VDSControl.swift => Control.swift} (87%) rename VDS/Classes/{VDSView.swift => View.swift} (88%) rename VDS/Components/Checkbox/{VDSCheckbox.swift => Checkbox.swift} (97%) rename VDS/Components/Checkbox/{VDSCheckboxModel.swift => CheckboxModel.swift} (85%) rename VDS/Components/Label/{VDSLabel.swift => Label.swift} (82%) rename VDS/Components/Label/{VDSLabelModel.swift => LabelModel.swift} (81%) rename VDS/Components/Toggle/{VDSToggle.swift => Toggle.swift} (98%) rename VDS/Components/Toggle/{VDSToggleModel.swift => ToggleModel.swift} (83%) create mode 100644 VDS/Protocols/Errorable.swift diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 7b0d076f..7c53f747 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -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 = ""; }; 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 = ""; }; 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 = ""; }; - EA3361A1288B1E840071C351 /* VDSToggleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSToggleModel.swift; sourceTree = ""; }; + EA3361A1288B1E840071C351 /* ToggleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleModel.swift; sourceTree = ""; }; EA3361A7288B23300071C351 /* UIColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = ""; }; 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 /* VDSControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSControl.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 = ""; }; EA3361BE288B2EA60071C351 /* ModelHandlerable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelHandlerable.swift; sourceTree = ""; }; - EA3361C228902D960071C351 /* VDSToggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSToggle.swift; sourceTree = ""; }; + EA3361C228902D960071C351 /* Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toggle.swift; sourceTree = ""; }; EA3361C4289030FC0071C351 /* Accessable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Accessable.swift; sourceTree = ""; }; EA3361C8289054C50071C351 /* Surfaceable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Surfaceable.swift; sourceTree = ""; }; EA3361F32891D5290071C351 /* VDSTypographyTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSTypographyTokens.xcframework; path = ../SharedFrameworks/VDSTypographyTokens.xcframework; sourceTree = ""; }; @@ -89,16 +90,17 @@ EA33622F2891EB4A0071C351 /* VDSFonts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSFonts.swift; sourceTree = ""; }; EA3362312891F2ED0071C351 /* VDSFontStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSFontStyles.swift; sourceTree = ""; }; EA33623D2892EE950071C351 /* UIDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIDevice.swift; sourceTree = ""; }; - EA33623F2892EF6B0071C351 /* VDSLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSLabel.swift; sourceTree = ""; }; - EA3362422892EFF20071C351 /* VDSLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSLabelModel.swift; sourceTree = ""; }; + EA33623F2892EF6B0071C351 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = ""; }; + EA3362422892EFF20071C351 /* LabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelModel.swift; sourceTree = ""; }; EA3362442892F9130071C351 /* Labelable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Labelable.swift; sourceTree = ""; }; EA33624628931B050071C351 /* Initable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Initable.swift; sourceTree = ""; }; EA3C3B4B2894823E000CA526 /* AnyProxy-PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AnyProxy-PropertyWrapper.swift"; sourceTree = ""; }; - EAF7F0932899861000B287F5 /* VDSCheckbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VDSCheckbox.swift; sourceTree = ""; }; - EAF7F0942899861000B287F5 /* VDSCheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VDSCheckboxModel.swift; sourceTree = ""; }; + EAF7F0932899861000B287F5 /* Checkbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = ""; }; + EAF7F0942899861000B287F5 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = ""; }; EAF7F0992899B17200B287F5 /* CATransaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CATransaction.swift; sourceTree = ""; }; - EAF7F09D289AAEC000B287F5 /* VDSConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSConstants.swift; sourceTree = ""; }; - EAF7F09F289AB7EC00B287F5 /* VDSView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSView.swift; sourceTree = ""; }; + EAF7F09D289AAEC000B287F5 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; + EAF7F09F289AB7EC00B287F5 /* View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.swift; sourceTree = ""; }; + EAF7F0A1289AFB3900B287F5 /* Errorable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errorable.swift; sourceTree = ""; }; /* 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 = ""; @@ -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 = ""; @@ -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 = ""; @@ -274,8 +277,8 @@ EA3362412892EF700071C351 /* Label */ = { isa = PBXGroup; children = ( - EA33623F2892EF6B0071C351 /* VDSLabel.swift */, - EA3362422892EFF20071C351 /* VDSLabelModel.swift */, + EA33623F2892EF6B0071C351 /* Label.swift */, + EA3362422892EFF20071C351 /* LabelModel.swift */, ); path = Label; sourceTree = ""; @@ -283,8 +286,8 @@ EAF7F092289985E200B287F5 /* Checkbox */ = { isa = PBXGroup; children = ( - EAF7F0932899861000B287F5 /* VDSCheckbox.swift */, - EAF7F0942899861000B287F5 /* VDSCheckboxModel.swift */, + EAF7F0932899861000B287F5 /* Checkbox.swift */, + EAF7F0942899861000B287F5 /* CheckboxModel.swift */, ); path = Checkbox; sourceTree = ""; @@ -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"; }; diff --git a/VDS/Classes/VDSConstants.swift b/VDS/Classes/Constants.swift similarity index 81% rename from VDS/Classes/VDSConstants.swift rename to VDS/Classes/Constants.swift index b4655d68..1df21e1d 100644 --- a/VDS/Classes/VDSConstants.swift +++ b/VDS/Classes/Constants.swift @@ -7,12 +7,13 @@ import Foundation +public struct Constants { + public static let ModelStateDebounce = 0.02 + public static let PaddingOne = 10.0 +} + public func updated (_ value: T, with update: (inout T) -> Void) -> T { var editable = value update(&editable) return editable } - -public struct VDSConstants { - public static let ModelStateDebounce = 0.02 -} diff --git a/VDS/Classes/VDSControl.swift b/VDS/Classes/Control.swift similarity index 87% rename from VDS/Classes/VDSControl.swift rename to VDS/Classes/Control.swift index 8798a721..e1a0726e 100644 --- a/VDS/Classes/VDSControl.swift +++ b/VDS/Classes/Control.swift @@ -10,7 +10,7 @@ import UIKit import Combine -open class VDSControl: UIControl, ModelHandlerable, ViewProtocol { +open class Control: UIControl, ModelHandlerable, ViewProtocol { @Published public var model: ModelType private var cancellable: AnyCancellable? @@ -52,7 +52,7 @@ open class VDSControl: 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() diff --git a/VDS/Classes/VDSView.swift b/VDS/Classes/View.swift similarity index 88% rename from VDS/Classes/VDSView.swift rename to VDS/Classes/View.swift index ed699316..8bdf9191 100644 --- a/VDS/Classes/VDSView.swift +++ b/VDS/Classes/View.swift @@ -10,7 +10,7 @@ import UIKit import Combine -open class VDSView: UIView, ModelHandlerable, ViewProtocol { +open class View: UIView, ModelHandlerable, ViewProtocol { @Published public var model: ModelType private var cancellable: AnyCancellable? @@ -52,7 +52,7 @@ open class VDSView: 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() diff --git a/VDS/Components/Checkbox/VDSCheckbox.swift b/VDS/Components/Checkbox/Checkbox.swift similarity index 97% rename from VDS/Components/Checkbox/VDSCheckbox.swift rename to VDS/Components/Checkbox/Checkbox.swift index 29baf6cf..74eaaf76 100644 --- a/VDS/Components/Checkbox/VDSCheckbox.swift +++ b/VDS/Components/Checkbox/Checkbox.swift @@ -19,9 +19,9 @@ import Combine Knob: The circular indicator that slides on the container. */ -public class VDSCheckbox: VDSCheckboxBase{} +public class Checkbox: CheckboxBase{} -open class VDSCheckboxBase: VDSControl, Changable { +open class CheckboxBase: Control, Changable { //-------------------------------------------------- // MARK: - Private Properties @@ -49,20 +49,20 @@ open class VDSCheckboxBase: VDSControl, 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: VDSControl, 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 diff --git a/VDS/Components/Checkbox/VDSCheckboxModel.swift b/VDS/Components/Checkbox/CheckboxModel.swift similarity index 85% rename from VDS/Components/Checkbox/VDSCheckboxModel.swift rename to VDS/Components/Checkbox/CheckboxModel.swift index 31b21f3e..80845fa5 100644 --- a/VDS/Components/Checkbox/VDSCheckboxModel.swift +++ b/VDS/Components/Checkbox/CheckboxModel.swift @@ -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 diff --git a/VDS/Components/Label/VDSLabel.swift b/VDS/Components/Label/Label.swift similarity index 82% rename from VDS/Components/Label/VDSLabel.swift rename to VDS/Components/Label/Label.swift index d36be140..b29bc484 100644 --- a/VDS/Components/Label/VDSLabel.swift +++ b/VDS/Components/Label/Label.swift @@ -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 } } diff --git a/VDS/Components/Label/VDSLabelModel.swift b/VDS/Components/Label/LabelModel.swift similarity index 81% rename from VDS/Components/Label/VDSLabelModel.swift rename to VDS/Components/Label/LabelModel.swift index 8644762d..e6527435 100644 --- a/VDS/Components/Label/VDSLabelModel.swift +++ b/VDS/Components/Label/LabelModel.swift @@ -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 diff --git a/VDS/Components/Toggle/VDSToggle.swift b/VDS/Components/Toggle/Toggle.swift similarity index 98% rename from VDS/Components/Toggle/VDSToggle.swift rename to VDS/Components/Toggle/Toggle.swift index 3e41953b..b4cae57b 100644 --- a/VDS/Components/Toggle/VDSToggle.swift +++ b/VDS/Components/Toggle/Toggle.swift @@ -18,9 +18,9 @@ import Combine Knob: The circular indicator that slides on the container. */ -public class VDSToggle: VDSToggleBase{} +public class Toggle: ToggleBase{} -open class VDSToggleBase: VDSControl, Changable { +open class ToggleBase: Control, Changable { //-------------------------------------------------- // MARK: - Private Properties @@ -33,8 +33,8 @@ open class VDSToggleBase: VDSControl, Chan return stackView }() - private var label: VDSLabel = { - let label = VDSLabel() + private var label: Label = { + let label = Label() label.translatesAutoresizingMaskIntoConstraints = false return label }() diff --git a/VDS/Components/Toggle/VDSToggleModel.swift b/VDS/Components/Toggle/ToggleModel.swift similarity index 83% rename from VDS/Components/Toggle/VDSToggleModel.swift rename to VDS/Components/Toggle/ToggleModel.swift index cbed8cf7..1ae6d3ab 100644 --- a/VDS/Components/Toggle/VDSToggleModel.swift +++ b/VDS/Components/Toggle/ToggleModel.swift @@ -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 diff --git a/VDS/Protocols/Errorable.swift b/VDS/Protocols/Errorable.swift new file mode 100644 index 00000000..bd9b41de --- /dev/null +++ b/VDS/Protocols/Errorable.swift @@ -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 } +} diff --git a/VDS/Utilities/TypeAlias.swift b/VDS/Utilities/TypeAlias.swift index 3ae8a9f8..e0f7095e 100644 --- a/VDS/Utilities/TypeAlias.swift +++ b/VDS/Utilities/TypeAlias.swift @@ -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 - } }