From 1e046fa336ad3cb4d1b3c8471a783aca3effc337 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 20 Oct 2022 15:41:41 -0500 Subject: [PATCH] removed / replaced anything to do with model Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 56 +---------- VDS/Classes/CollectionView.swift | 96 ------------------- VDS/Classes/CollectionViewCell.swift | 81 ---------------- VDS/Classes/ColorConfiguration.swift | 44 ++++----- VDS/Classes/Constants.swift | 2 +- VDS/Classes/Control.swift | 2 +- VDS/Classes/SelectorGroupHandlerBase.swift | 28 ++---- VDS/Classes/View.swift | 2 +- VDS/Components/Button/Button.swift | 8 +- VDS/Components/Checkbox/Checkbox.swift | 12 +-- VDS/Components/Checkbox/CheckboxGroup.swift | 6 +- VDS/Components/Label/Label.swift | 2 +- VDS/Components/RadioBox/RadioBox.swift | 2 +- VDS/Components/RadioBox/RadioBoxGroup.swift | 15 +-- VDS/Components/RadioButton/RadioButton.swift | 2 +- .../RadioButton/RadioButtonGroup.swift | 4 +- .../RadioSwatch/RadioSwatchGroup.swift | 6 +- VDS/PropertyWrappers/AnyProxy.swift | 45 --------- VDS/PropertyWrappers/CodableColor.swift | 57 ----------- VDS/PropertyWrappers/Debuggable.swift | 31 ------ VDS/PropertyWrappers/UsesAutoLayout.swift | 23 ----- VDS/Protocols/Accessable.swift | 2 +- VDS/Protocols/Colorable.swift | 26 ++--- ...delHandlerable.swift => Handlerable.swift} | 10 +- VDS/Protocols/Labelable.swift | 20 ---- VDS/Protocols/Modelable.swift | 18 ---- VDS/Protocols/Selectable.swift | 12 --- VDS/Protocols/SelectorGroupModelable.swift | 37 ------- 28 files changed, 75 insertions(+), 574 deletions(-) delete mode 100644 VDS/Classes/CollectionView.swift delete mode 100644 VDS/Classes/CollectionViewCell.swift delete mode 100644 VDS/PropertyWrappers/AnyProxy.swift delete mode 100644 VDS/PropertyWrappers/CodableColor.swift delete mode 100644 VDS/PropertyWrappers/Debuggable.swift delete mode 100644 VDS/PropertyWrappers/UsesAutoLayout.swift rename VDS/Protocols/{ModelHandlerable.swift => Handlerable.swift} (64%) delete mode 100644 VDS/Protocols/Labelable.swift delete mode 100644 VDS/Protocols/Modelable.swift delete mode 100644 VDS/Protocols/Selectable.swift delete mode 100644 VDS/Protocols/SelectorGroupModelable.swift diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 56ad00b9..72db300b 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -9,8 +9,6 @@ /* Begin PBXBuildFile section */ 5F21D7BF28DCEB3D003E7CD6 /* Useable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F21D7BE28DCEB3D003E7CD6 /* Useable.swift */; }; 5FC35BE328D51405004EBEAC /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC35BE228D51405004EBEAC /* Button.swift */; }; - EA1F265D28B944F00033E859 /* CollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA1F265B28B944F00033E859 /* CollectionView.swift */; }; - EA1F265E28B944F00033E859 /* CollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA1F265C28B944F00033E859 /* CollectionViewCell.swift */; }; EA1F266528B945070033E859 /* RadioSwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA1F266128B945070033E859 /* RadioSwatch.swift */; }; EA1F266628B945070033E859 /* RadioSwatchGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA1F266228B945070033E859 /* RadioSwatchGroup.swift */; }; EA336171288B19200071C351 /* VDS.docc in Sources */ = {isa = PBXBuildFile; fileRef = EA336170288B19200071C351 /* VDS.docc */; }; @@ -24,7 +22,7 @@ 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 */; }; + EA3361BF288B2EA60071C351 /* Handlerable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361BE288B2EA60071C351 /* Handlerable.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 */; }; @@ -37,17 +35,13 @@ EA3362302891EB4A0071C351 /* Fonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33622F2891EB4A0071C351 /* Fonts.swift */; }; EA33623E2892EE950071C351 /* UIDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33623D2892EE950071C351 /* UIDevice.swift */; }; EA3362402892EF6C0071C351 /* Label.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33623F2892EF6B0071C351 /* Label.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.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3C3B4B2894823E000CA526 /* AnyProxy.swift */; }; EA4DB18528CA967F00103EE3 /* SelectorGroupHandlerBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA4DB18428CA967F00103EE3 /* SelectorGroupHandlerBase.swift */; }; EA4DB2FD28D3D0CA00103EE3 /* AnyEquatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA4DB2FC28D3D0CA00103EE3 /* AnyEquatable.swift */; }; EA4DB30228DCBCA500103EE3 /* Badge.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA4DB30128DCBCA500103EE3 /* Badge.swift */; }; - EA84F6B128B94A2500D67ABC /* CodableColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA84F6B028B94A2500D67ABC /* CodableColor.swift */; }; EA89200228AECF2A006B9984 /* UIButton+Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89200128AECF2A006B9984 /* UIButton+Publisher.swift */; }; EA89200428AECF4B006B9984 /* UITextField+Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89200328AECF4B006B9984 /* UITextField+Publisher.swift */; }; EA89200628B526D6006B9984 /* CheckboxGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89200528B526D6006B9984 /* CheckboxGroup.swift */; }; - EA89200F28B53921006B9984 /* Selectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89200E28B53921006B9984 /* Selectable.swift */; }; EA89201328B568D8006B9984 /* RadioBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89201228B568D8006B9984 /* RadioBox.swift */; }; EA89201528B56CF4006B9984 /* RadioBoxGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89201428B56CF4006B9984 /* RadioBoxGroup.swift */; }; EAA5EEE228F4C62C003B3210 /* Colorable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEE128F4C62C003B3210 /* Colorable.swift */; }; @@ -58,10 +52,7 @@ EAA5EEF228F5C909003B3210 /* VDSColorTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAA5EEED28F5C908003B3210 /* VDSColorTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; EAA5EEF328F5C909003B3210 /* VDSFormControlsTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAA5EEEE28F5C908003B3210 /* VDSFormControlsTokens.xcframework */; }; EAA5EEF428F5C909003B3210 /* VDSFormControlsTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAA5EEEE28F5C908003B3210 /* VDSFormControlsTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - EAB1D29A28A5611D00DAE764 /* SelectorGroupModelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB1D29928A5611D00DAE764 /* SelectorGroupModelable.swift */; }; EAB1D29C28A5618900DAE764 /* RadioButtonGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB1D29B28A5618900DAE764 /* RadioButtonGroup.swift */; }; - EAB1D2A128A598FE00DAE764 /* UsesAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB1D2A028A598FE00DAE764 /* UsesAutoLayout.swift */; }; - EAB1D2A328A5994800DAE764 /* Debuggable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB1D2A228A5994800DAE764 /* Debuggable.swift */; }; EAB1D2CD28ABE76100DAE764 /* Withable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB1D2CC28ABE76000DAE764 /* Withable.swift */; }; EAB1D2CF28ABEF2B00DAE764 /* Typography.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB1D2CE28ABEF2B00DAE764 /* Typography.swift */; }; EAB1D2E628AE842000DAE764 /* Publisher+Bind.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB1D2E328AE842000DAE764 /* Publisher+Bind.swift */; }; @@ -82,7 +73,6 @@ EAF7F0B5289C126F00B287F5 /* UILabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B4289C126F00B287F5 /* UILabel.swift */; }; EAF7F0B7289C12A600B287F5 /* UITapGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */; }; EAF7F0B9289C139800B287F5 /* ColorConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */; }; - EAF7F0BB289D80ED00B287F5 /* Modelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0BA289D80ED00B287F5 /* Modelable.swift */; }; EAF7F11728A1475A00B287F5 /* RadioButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F11528A1475A00B287F5 /* RadioButton.swift */; }; EAF7F13328A2A16500B287F5 /* LabelAttributeAttachment.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F13228A2A16500B287F5 /* LabelAttributeAttachment.swift */; }; /* End PBXBuildFile section */ @@ -116,8 +106,6 @@ /* Begin PBXFileReference section */ 5F21D7BE28DCEB3D003E7CD6 /* Useable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Useable.swift; sourceTree = ""; }; 5FC35BE228D51405004EBEAC /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; - EA1F265B28B944F00033E859 /* CollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionView.swift; sourceTree = ""; }; - EA1F265C28B944F00033E859 /* CollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewCell.swift; sourceTree = ""; }; EA1F266128B945070033E859 /* RadioSwatch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioSwatch.swift; sourceTree = ""; }; EA1F266228B945070033E859 /* RadioSwatchGroup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioSwatchGroup.swift; sourceTree = ""; }; EA33616C288B19200071C351 /* VDS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = VDS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -132,7 +120,7 @@ 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 = ""; }; + EA3361BE288B2EA60071C351 /* Handlerable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Handlerable.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 = ""; }; @@ -145,17 +133,13 @@ EA33622F2891EB4A0071C351 /* Fonts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fonts.swift; sourceTree = ""; }; EA33623D2892EE950071C351 /* UIDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIDevice.swift; sourceTree = ""; }; EA33623F2892EF6B0071C351 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.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.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnyProxy.swift; sourceTree = ""; }; EA4DB18428CA967F00103EE3 /* SelectorGroupHandlerBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectorGroupHandlerBase.swift; sourceTree = ""; }; EA4DB2FC28D3D0CA00103EE3 /* AnyEquatable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnyEquatable.swift; sourceTree = ""; }; EA4DB30128DCBCA500103EE3 /* Badge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Badge.swift; sourceTree = ""; }; - EA84F6B028B94A2500D67ABC /* CodableColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableColor.swift; sourceTree = ""; }; EA89200128AECF2A006B9984 /* UIButton+Publisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+Publisher.swift"; sourceTree = ""; }; EA89200328AECF4B006B9984 /* UITextField+Publisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Publisher.swift"; sourceTree = ""; }; EA89200528B526D6006B9984 /* CheckboxGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckboxGroup.swift; sourceTree = ""; }; - EA89200E28B53921006B9984 /* Selectable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Selectable.swift; sourceTree = ""; }; EA89201228B568D8006B9984 /* RadioBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioBox.swift; sourceTree = ""; }; EA89201428B56CF4006B9984 /* RadioBoxGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioBoxGroup.swift; sourceTree = ""; }; EAA5EEE128F4C62C003B3210 /* Colorable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Colorable.swift; sourceTree = ""; }; @@ -163,10 +147,7 @@ EAA5EEEC28F5C908003B3210 /* VDSTypographyTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSTypographyTokens.xcframework; path = ../SharedFrameworks/VDSTypographyTokens.xcframework; sourceTree = ""; }; EAA5EEED28F5C908003B3210 /* VDSColorTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSColorTokens.xcframework; path = ../SharedFrameworks/VDSColorTokens.xcframework; sourceTree = ""; }; EAA5EEEE28F5C908003B3210 /* VDSFormControlsTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSFormControlsTokens.xcframework; path = ../SharedFrameworks/VDSFormControlsTokens.xcframework; sourceTree = ""; }; - EAB1D29928A5611D00DAE764 /* SelectorGroupModelable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectorGroupModelable.swift; sourceTree = ""; }; EAB1D29B28A5618900DAE764 /* RadioButtonGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioButtonGroup.swift; sourceTree = ""; }; - EAB1D2A028A598FE00DAE764 /* UsesAutoLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UsesAutoLayout.swift; sourceTree = ""; }; - EAB1D2A228A5994800DAE764 /* Debuggable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Debuggable.swift; sourceTree = ""; }; EAB1D2CC28ABE76000DAE764 /* Withable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Withable.swift; sourceTree = ""; }; EAB1D2CE28ABEF2B00DAE764 /* Typography.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Typography.swift; sourceTree = ""; }; EAB1D2E328AE842000DAE764 /* Publisher+Bind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Publisher+Bind.swift"; sourceTree = ""; }; @@ -187,7 +168,6 @@ EAF7F0B4289C126F00B287F5 /* UILabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UILabel.swift; sourceTree = ""; }; EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITapGestureRecognizer.swift; sourceTree = ""; }; EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorConfiguration.swift; sourceTree = ""; }; - EAF7F0BA289D80ED00B287F5 /* Modelable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Modelable.swift; sourceTree = ""; }; EAF7F11528A1475A00B287F5 /* RadioButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioButton.swift; sourceTree = ""; }; EAF7F13228A2A16500B287F5 /* LabelAttributeAttachment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeAttachment.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -258,7 +238,6 @@ EA3361A6288B23240071C351 /* Extensions */, EA3361DF2891D0F10071C351 /* Fonts */, EA3361AB288B25EC0071C351 /* Protocols */, - EAB1D29F28A598D000DAE764 /* PropertyWrappers */, EAB1D2E228AE842000DAE764 /* Publishers */, EAB1D2D028ABEF3100DAE764 /* Typography */, EA3361B9288B2BE30071C351 /* Utilities */, @@ -333,13 +312,9 @@ EA3361A9288B25E40071C351 /* Disabling.swift */, EAF7F0A1289AFB3900B287F5 /* Errorable.swift */, EA3361AE288B26310071C351 /* FormFieldable.swift */, + EA3361BE288B2EA60071C351 /* Handlerable.swift */, EA33624628931B050071C351 /* Initable.swift */, - EA3362442892F9130071C351 /* Labelable.swift */, - EAF7F0BA289D80ED00B287F5 /* Modelable.swift */, - EA3361BE288B2EA60071C351 /* ModelHandlerable.swift */, EAF7F0A5289B0CE000B287F5 /* Resetable.swift */, - EA89200E28B53921006B9984 /* Selectable.swift */, - EAB1D29928A5611D00DAE764 /* SelectorGroupModelable.swift */, EA3361C8289054C50071C351 /* Surfaceable.swift */, EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */, EAB1D2CC28ABE76000DAE764 /* Withable.swift */, @@ -351,8 +326,6 @@ EA3361B4288B2A360071C351 /* Classes */ = { isa = PBXGroup; children = ( - EA1F265B28B944F00033E859 /* CollectionView.swift */, - EA1F265C28B944F00033E859 /* CollectionViewCell.swift */, EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */, EAF7F09D289AAEC000B287F5 /* Constants.swift */, EA3361B5288B2A410071C351 /* Control.swift */, @@ -425,17 +398,6 @@ path = RadioBox; sourceTree = ""; }; - EAB1D29F28A598D000DAE764 /* PropertyWrappers */ = { - isa = PBXGroup; - children = ( - EA3C3B4B2894823E000CA526 /* AnyProxy.swift */, - EA84F6B028B94A2500D67ABC /* CodableColor.swift */, - EAB1D2A228A5994800DAE764 /* Debuggable.swift */, - EAB1D2A028A598FE00DAE764 /* UsesAutoLayout.swift */, - ); - path = PropertyWrappers; - sourceTree = ""; - }; EAB1D2D028ABEF3100DAE764 /* Typography */ = { isa = PBXGroup; children = ( @@ -609,7 +571,6 @@ EA3361C328902D960071C351 /* Toggle.swift in Sources */, EAF7F0A0289AB7EC00B287F5 /* View.swift in Sources */, EA89201328B568D8006B9984 /* RadioBox.swift in Sources */, - EA84F6B128B94A2500D67ABC /* CodableColor.swift in Sources */, EA3362402892EF6C0071C351 /* Label.swift in Sources */, EAF7F0B3289B1ADC00B287F5 /* LabelAttributeAction.swift in Sources */, EA33622E2891EA3C0071C351 /* DispatchQueue+Once.swift in Sources */, @@ -618,11 +579,9 @@ EA3361C5289030FC0071C351 /* Accessable.swift in Sources */, EA33622C2891E73B0071C351 /* FontProtocol.swift in Sources */, EAF7F11728A1475A00B287F5 /* RadioButton.swift in Sources */, - EAB1D2A128A598FE00DAE764 /* UsesAutoLayout.swift in Sources */, EAB1D2CD28ABE76100DAE764 /* Withable.swift in Sources */, EAF7F0952899861000B287F5 /* Checkbox.swift in Sources */, EA3361C9289054C50071C351 /* Surfaceable.swift in Sources */, - EA1F265D28B944F00033E859 /* CollectionView.swift in Sources */, EA4DB30228DCBCA500103EE3 /* Badge.swift in Sources */, EA33624728931B050071C351 /* Initable.swift in Sources */, EAF7F0A4289B017C00B287F5 /* LabelAttributeModel.swift in Sources */, @@ -635,12 +594,8 @@ EA3361BD288B2C760071C351 /* TypeAlias.swift in Sources */, EAB1D2CF28ABEF2B00DAE764 /* Typography.swift in Sources */, EAF7F09A2899B17200B287F5 /* CATransaction.swift in Sources */, - EA89200F28B53921006B9984 /* Selectable.swift in Sources */, EAF7F0A2289AFB3900B287F5 /* Errorable.swift in Sources */, - EA3C3B4C2894823E000CA526 /* AnyProxy.swift in Sources */, EA3361AF288B26310071C351 /* FormFieldable.swift in Sources */, - EAB1D29A28A5611D00DAE764 /* SelectorGroupModelable.swift in Sources */, - EAF7F0BB289D80ED00B287F5 /* Modelable.swift in Sources */, EA89201528B56CF4006B9984 /* RadioBoxGroup.swift in Sources */, EAF7F09E289AAEC000B287F5 /* Constants.swift in Sources */, EA1F266528B945070033E859 /* RadioSwatch.swift in Sources */, @@ -652,18 +607,15 @@ EAB1D2E628AE842000DAE764 /* Publisher+Bind.swift in Sources */, EA3361AA288B25E40071C351 /* Disabling.swift in Sources */, EA3361B6288B2A410071C351 /* Control.swift in Sources */, - EAB1D2A328A5994800DAE764 /* Debuggable.swift in Sources */, 5F21D7BF28DCEB3D003E7CD6 /* Useable.swift in Sources */, EAF7F0B7289C12A600B287F5 /* UITapGestureRecognizer.swift in Sources */, - EA3362452892F9130071C351 /* Labelable.swift in Sources */, EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */, EAA5EEE228F4C62C003B3210 /* Colorable.swift in Sources */, EA33623E2892EE950071C351 /* UIDevice.swift in Sources */, EA3362302891EB4A0071C351 /* Fonts.swift in Sources */, - EA1F265E28B944F00033E859 /* CollectionViewCell.swift in Sources */, EAF7F0AD289B142900B287F5 /* LabelAttributeStrikeThrough.swift in Sources */, EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */, - EA3361BF288B2EA60071C351 /* ModelHandlerable.swift in Sources */, + EA3361BF288B2EA60071C351 /* Handlerable.swift in Sources */, EA3361A8288B23300071C351 /* UIColor.swift in Sources */, EA1F266628B945070033E859 /* RadioSwatchGroup.swift in Sources */, 5FC35BE328D51405004EBEAC /* Button.swift in Sources */, diff --git a/VDS/Classes/CollectionView.swift b/VDS/Classes/CollectionView.swift deleted file mode 100644 index d74d88d6..00000000 --- a/VDS/Classes/CollectionView.swift +++ /dev/null @@ -1,96 +0,0 @@ -// -// CollectionView.swift -// VDS -// -// Created by Matt Bruce on 8/25/22. -// - -import Foundation -import UIKit -import Combine - -open class CollectionView: UICollectionView, ModelHandlerable, ViewProtocol, Resettable { - - //-------------------------------------------------- - // MARK: - Combine Properties - //-------------------------------------------------- - public var subject = PassthroughSubject() - public var subscribers = Set() - - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - private var initialSetupPerformed = false - - open var surface: Surface = .light { didSet { didChange() }} - - open var disabled: Bool = false { didSet { isEnabled = !disabled } } - - open var isEnabled: Bool { - get { !disabled } - set { - if disabled != !newValue { - disabled = !newValue - } - isUserInteractionEnabled = isEnabled - didChange() - } - } - - //-------------------------------------------------- - // MARK: - Initializers - //-------------------------------------------------- - required public init() { - super.init(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()) - initialSetup() - } - - public required init(collectionViewLayout layout: UICollectionViewLayout) { - super.init(frame: .zero, collectionViewLayout: layout) - initialSetup() - } - - public override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) { - super.init(frame: frame, collectionViewLayout: layout) - initialSetup() - } - - public required init?(coder: NSCoder) { - super.init(coder: coder) - initialSetup() - } - - //-------------------------------------------------- - // MARK: - Setup - //-------------------------------------------------- - - open func initialSetup() { - if !initialSetupPerformed { - initialSetupPerformed = true - setup() - } - } - - open override func layoutSubviews() { - super.layoutSubviews() - updateView() - } - - //-------------------------------------------------- - // MARK: - Overrides - //-------------------------------------------------- - open func updateView() {} - - open func reset() { - backgroundColor = .clear - surface = .light - disabled = false - } - - // MARK: - ViewProtocol - /// Will be called only once. - open func setup() { - translatesAutoresizingMaskIntoConstraints = false - insetsLayoutMarginsFromSafeArea = false - } -} diff --git a/VDS/Classes/CollectionViewCell.swift b/VDS/Classes/CollectionViewCell.swift deleted file mode 100644 index 753389fd..00000000 --- a/VDS/Classes/CollectionViewCell.swift +++ /dev/null @@ -1,81 +0,0 @@ -// -// CollectionViewCell.swift -// VDS -// -// Created by Matt Bruce on 8/25/22. -// - -import Foundation -import UIKit -import Combine - -open class CollectionViewCell: UICollectionViewCell, ViewProtocol { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - private var initialSetupPerformed = false - - public var modelHandler: ModelHandlerType? { - didSet { - if let oldValue { - oldValue.removeFromSuperview() - } - if let modelHandler { - addSubview(modelHandler) - modelHandler.didChange() - modelHandler.topAnchor.constraint(equalTo: topAnchor).isActive = true - modelHandler.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true - modelHandler.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true - modelHandler.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true - } - } - } - - open var surface: Surface = .light { didSet { modelHandler?.surface = surface } } - - open var disabled: Bool = false { didSet{ modelHandler?.disabled = disabled } } - - //-------------------------------------------------- - // MARK: - Initializers - //-------------------------------------------------- - required public init() { - super.init(frame: .zero) - initialSetup() - } - - public override init(frame: CGRect) { - super.init(frame: frame) - initialSetup() - } - - public required init?(coder: NSCoder) { - super.init(coder: coder) - initialSetup() - } - - //-------------------------------------------------- - // MARK: - Setup - //-------------------------------------------------- - - open func initialSetup() { - if !initialSetupPerformed { - initialSetupPerformed = true - setup() - } - } - - // MARK: - ViewProtocol - /// Will be called only once. - open func setup() { - translatesAutoresizingMaskIntoConstraints = false - insetsLayoutMarginsFromSafeArea = false - - } - - open override func prepareForReuse() { - super.prepareForReuse() - if let handler = modelHandler as? Resettable { - handler.reset() - } - } -} diff --git a/VDS/Classes/ColorConfiguration.swift b/VDS/Classes/ColorConfiguration.swift index e86756fe..89cfe2c4 100644 --- a/VDS/Classes/ColorConfiguration.swift +++ b/VDS/Classes/ColorConfiguration.swift @@ -23,13 +23,13 @@ public typealias ObjectColorable = Colorable & Initable & ObjectWithable /// /// let textColor = config.getColor(model) //returns .black final public class SurfaceColorConfiguration: ObjectColorable { - public typealias ModelType = Surfaceable + public typealias ObjectType = Surfaceable public var lightColor: UIColor = .clear public var darkColor: UIColor = .clear required public init(){} - public func getColor(_ viewModel: any ModelType) -> UIColor { - return viewModel.surface == .light ? lightColor : darkColor + public func getColor(_ object: any ObjectType) -> UIColor { + return object.surface == .light ? lightColor : darkColor } } @@ -42,8 +42,8 @@ public protocol DisabledSurfaceColorable: ObjectColorable { } extension DisabledSurfaceColorable { - public func getDisabledColor (_ viewModel: M) -> UIColor { - viewModel.disabled ? disabled.getColor(viewModel) : enabled.getColor(viewModel) + public func getDisabledColor (_ object: M) -> UIColor { + object.disabled ? disabled.getColor(object) : enabled.getColor(object) } } @@ -69,14 +69,14 @@ extension DisabledSurfaceColorable { /// /// final public class DisabledSurfaceColorConfiguration: DisabledSurfaceColorable { - public typealias ModelType = Surfaceable & Disabling + public typealias ObjectType = Surfaceable & Disabling public var disabled = SurfaceColorConfiguration() public var enabled = SurfaceColorConfiguration() required public init(){} - public func getColor(_ viewModel: any ModelType) -> UIColor { - getDisabledColor(viewModel) + public func getColor(_ object: any ObjectType) -> UIColor { + getDisabledColor(object) } } @@ -84,15 +84,11 @@ final public class DisabledSurfaceColorConfiguration: DisabledSurfaceColorable { ///MARK -- BinaryColorable ///------------------------------------------------------------------- public protocol BinaryColorable{ - var userTrueColor: Bool { get } + var useTrueColor: Bool { get } } extension BinaryColorable where Self: Control { - public var userTrueColor: Bool { return isSelected } -} - -extension BinaryColorable where Self: Selectable { - public var userTrueColor: Bool { return selected } + public var useTrueColor: Bool { return isSelected } } ///------------------------------------------------------------------- @@ -104,8 +100,8 @@ public protocol BinarySurfaceColorable: ObjectColorable { } extension BinarySurfaceColorable { - public func getBinaryColor(_ viewModel: M) -> UIColor { - viewModel.userTrueColor ? forTrue.getColor(viewModel) : forFalse.getColor(viewModel) + public func getBinaryColor(_ object: M) -> UIColor { + object.useTrueColor ? forTrue.getColor(object) : forFalse.getColor(object) } } @@ -130,14 +126,14 @@ extension BinarySurfaceColorable { /// /// final public class BinarySurfaceColorConfiguration: BinarySurfaceColorable { - public typealias ModelType = Surfaceable & BinaryColorable + public typealias ObjectType = Surfaceable & BinaryColorable public var forTrue = SurfaceColorConfiguration() public var forFalse = SurfaceColorConfiguration() required public init(){} - public func getColor(_ viewModel: any ModelType) -> UIColor { - getBinaryColor(viewModel) + public func getColor(_ object: any ObjectType) -> UIColor { + getBinaryColor(object) } } @@ -151,8 +147,8 @@ public protocol BinaryDisabledSurfaceColorable: ObjectColorable { } extension BinaryDisabledSurfaceColorable { - public func getBinaryColor(_ viewModel: M) -> UIColor { - viewModel.userTrueColor ? forTrue.getColor(viewModel) : forFalse.getColor(viewModel) + public func getBinaryColor(_ object: M) -> UIColor { + object.useTrueColor ? forTrue.getColor(object) : forFalse.getColor(object) } } @@ -183,13 +179,13 @@ extension BinaryDisabledSurfaceColorable { /// /// final public class BinaryDisabledSurfaceColorConfiguration: BinaryDisabledSurfaceColorable { - public typealias ModelType = Disabling & Surfaceable & BinaryColorable + public typealias ObjectType = Disabling & Surfaceable & BinaryColorable public var forTrue = DisabledSurfaceColorConfiguration() public var forFalse = DisabledSurfaceColorConfiguration() required public init(){} - public func getColor(_ viewModel: any ModelType) -> UIColor { - getBinaryColor(viewModel) + public func getColor(_ object: any ObjectType) -> UIColor { + getBinaryColor(object) } } diff --git a/VDS/Classes/Constants.swift b/VDS/Classes/Constants.swift index 2ad7285b..4928c3f1 100644 --- a/VDS/Classes/Constants.swift +++ b/VDS/Classes/Constants.swift @@ -8,6 +8,6 @@ import Foundation public struct Constants { - public static let ModelStateDebounce = 0.0 //.001 + public static let StateDebounce = 0.0 //.001 public static let PaddingOne = 10.0 } diff --git a/VDS/Classes/Control.swift b/VDS/Classes/Control.swift index ee069bf1..1eca6467 100644 --- a/VDS/Classes/Control.swift +++ b/VDS/Classes/Control.swift @@ -10,7 +10,7 @@ import UIKit import Combine -open class Control: UIControl, ModelHandlerable, ViewProtocol, Resettable { +open class Control: UIControl, Handlerable, ViewProtocol, Resettable { //-------------------------------------------------- // MARK: - Combine Properties diff --git a/VDS/Classes/SelectorGroupHandlerBase.swift b/VDS/Classes/SelectorGroupHandlerBase.swift index d44e229f..27c56353 100644 --- a/VDS/Classes/SelectorGroupHandlerBase.swift +++ b/VDS/Classes/SelectorGroupHandlerBase.swift @@ -8,12 +8,12 @@ import Foundation import UIKit -public class SelectorGroupHandlerBase: Control { +public class SelectorGroupHandlerBase: Control { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var selectorViews: [ModelHandlerType] = [] + public var selectorViews: [HandlerType] = [] //-------------------------------------------------- // MARK: - Overrides @@ -33,36 +33,20 @@ public class SelectorGroupHandlerBase: Control { } } } - - public func createModelHandler() -> ModelHandlerType { - //create view - let newSelectorView = ModelHandlerType() - - //add the selectedPublisher for the change - newSelectorView - .publisher(for: .touchUpInside) - .sink { [weak self] control in - self?.didSelect(control) - } - .store(in: &subscribers) - - return newSelectorView - - } - open func didSelect(_ selectedControl: ModelHandlerType) { + open func didSelect(_ selectedControl: HandlerType) { fatalError("Must override didSelect") } public func valueChanged() { - DispatchQueue.main.asyncAfter(deadline: .now() + Constants.ModelStateDebounce) { [weak self] in + DispatchQueue.main.asyncAfter(deadline: .now() + Constants.StateDebounce) { [weak self] in self?.sendActions(for: .valueChanged) } } } -public class SelectorGroupSelectedHandlerBase: SelectorGroupHandlerBase{ - public var selectedHandler: ModelHandlerType? { +public class SelectorGroupSelectedHandlerBase: SelectorGroupHandlerBase{ + public var selectedHandler: HandlerType? { return selectorViews.filter { $0.isSelected == true }.first } } diff --git a/VDS/Classes/View.swift b/VDS/Classes/View.swift index 3d0d3841..c8304ccb 100644 --- a/VDS/Classes/View.swift +++ b/VDS/Classes/View.swift @@ -10,7 +10,7 @@ import UIKit import Combine -open class View: UIView, ModelHandlerable, ViewProtocol, Resettable { +open class View: UIView, Handlerable, ViewProtocol, Resettable { //-------------------------------------------------- // MARK: - Combine Properties diff --git a/VDS/Components/Button/Button.swift b/VDS/Components/Button/Button.swift index 11f72e42..8fb5ec7e 100644 --- a/VDS/Components/Button/Button.swift +++ b/VDS/Components/Button/Button.swift @@ -16,7 +16,7 @@ public enum ButtonSize: String, Codable, CaseIterable { case small } -open class Button: UIButton, ModelHandlerable, ViewProtocol, Resettable, Useable { +open class Button: UIButton, Handlerable, ViewProtocol, Resettable, Useable { //-------------------------------------------------- // MARK: - Combine Properties @@ -197,14 +197,14 @@ open class Button: UIButton, ModelHandlerable, ViewProtocol, Resettable, Useable //-------------------------------------------------- private class UseableColorConfiguration: ObjectColorable { - typealias ModelType = Disabling & Surfaceable & Useable + typealias ObjectType = Disabling & Surfaceable & Useable public var primary = DisabledSurfaceColorConfiguration() public var secondary = DisabledSurfaceColorConfiguration() required public init(){} - public func getColor(_ viewModel: ModelType) -> UIColor { - return viewModel.use == .primary ? primary.getColor(viewModel) : secondary.getColor(viewModel) + public func getColor(_ object: ObjectType) -> UIColor { + return object.use == .primary ? primary.getColor(object) : secondary.getColor(object) } } diff --git a/VDS/Components/Checkbox/Checkbox.swift b/VDS/Components/Checkbox/Checkbox.swift index 0d020dbb..e2355e10 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, Accessable, BinaryColorable, Errorable { +open class CheckboxBase: Control, Accessable, DataTrackable, BinaryColorable, Errorable { //-------------------------------------------------- // MARK: - Initializers //-------------------------------------------------- @@ -367,21 +367,21 @@ open class CheckboxBase: Control, Accessable, BinaryColorable, Errorable { // MARK: - Color Class Configurations //-------------------------------------------------- internal class ErrorBinaryDisabledSurfaceColorConfiguration: BinaryDisabledSurfaceColorable { - typealias ModelType = Errorable & Disabling & Surfaceable & BinaryColorable + typealias ObjectType = Errorable & Disabling & Surfaceable & BinaryColorable var error = BinarySurfaceColorConfiguration() var forTrue = DisabledSurfaceColorConfiguration() var forFalse = DisabledSurfaceColorConfiguration() required init() {} - func getColor(_ viewModel: ModelType) -> UIColor { + func getColor(_ object: ObjectType) -> UIColor { //only show error is enabled and showError == true - let showErrorColor = !viewModel.disabled && viewModel.showError + let showErrorColor = !object.disabled && object.showError if showErrorColor { - return error.getColor(viewModel) + return error.getColor(object) } else { - return getBinaryColor(viewModel) + return getBinaryColor(object) } } } diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 29dfa4c9..105e916f 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -18,13 +18,13 @@ public class CheckboxGroup: CheckboxGroupBase { } } -public class CheckboxGroupBase: SelectorGroupHandlerBase { +public class CheckboxGroupBase: SelectorGroupHandlerBase { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public override var selectorViews: [ModelHandlerType] { + public override var selectorViews: [HandlerType] { didSet { for selector in selectorViews { if !mainStackView.arrangedSubviews.contains(selector) { @@ -84,7 +84,7 @@ public class CheckboxGroupBase: SelectorGroupHan mainStackView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true } - public var selectedModelHandlers: [ModelHandlerType]? { + public var selectedHandlers: [HandlerType]? { let selected = selectorViews.filter{ $0.isSelected == true } guard selected.count > 0 else { return nil } return selected diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index d56e7c70..be475664 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -12,7 +12,7 @@ import Combine public class Label: LabelBase {} -open class LabelBase: UILabel, ModelHandlerable, ViewProtocol, Resettable { +open class LabelBase: UILabel, Handlerable, ViewProtocol, Resettable { //-------------------------------------------------- // MARK: - Combine Properties diff --git a/VDS/Components/RadioBox/RadioBox.swift b/VDS/Components/RadioBox/RadioBox.swift index 4d3bc664..b0c77f43 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, BinaryColorable, Accessable { +open class RadioBoxBase: Control, BinaryColorable, Accessable, DataTrackable{ //-------------------------------------------------- // MARK: - Initializers //-------------------------------------------------- diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index 618eaf73..057cd18a 100644 --- a/VDS/Components/RadioBox/RadioBoxGroup.swift +++ b/VDS/Components/RadioBox/RadioBoxGroup.swift @@ -18,12 +18,12 @@ public class RadioBoxGroup: RadioBoxGroupBase { } } -public class RadioBoxGroupBase: SelectorGroupSelectedHandlerBase { +public class RadioBoxGroupBase: SelectorGroupSelectedHandlerBase { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public override var selectorViews: [ModelHandlerType] { + public override var selectorViews: [HandlerType] { didSet { for selector in selectorViews { if !mainStackView.arrangedSubviews.contains(selector) { @@ -86,15 +86,4 @@ public class RadioBoxGroupBase: SelectorGroupSel } }.store(in: &subscribers) } - - public var selectedModelHandler: ModelHandlerType? { - if let index = selectorViews.firstIndex(where: { element in - return element.isSelected == true - }) { - return selectorViews[index] - } else { - return nil - } - } - } diff --git a/VDS/Components/RadioButton/RadioButton.swift b/VDS/Components/RadioButton/RadioButton.swift index c5c42777..9b406fb6 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, Accessable, BinaryColorable, Errorable { +open class RadioButtonBase: Control, Accessable, DataTrackable, BinaryColorable, Errorable { //-------------------------------------------------- // MARK: - Initializers //-------------------------------------------------- diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index 9436d522..d3b103fa 100644 --- a/VDS/Components/RadioButton/RadioButtonGroup.swift +++ b/VDS/Components/RadioButton/RadioButtonGroup.swift @@ -20,12 +20,12 @@ public class RadioButtonGroup: RadioButtonGroupBase { } } -public class RadioButtonGroupBase: SelectorGroupSelectedHandlerBase { +public class RadioButtonGroupBase: SelectorGroupSelectedHandlerBase { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public override var selectorViews: [ModelHandlerType] { + public override var selectorViews: [HandlerType] { didSet { for selector in selectorViews { if !mainStackView.arrangedSubviews.contains(selector) { diff --git a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift index bba253e9..c3eca4a6 100644 --- a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift +++ b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift @@ -20,12 +20,12 @@ public class RadioSwatchGroup: RadioSwatchGroupBase { } -public class RadioSwatchGroupBase: SelectorGroupSelectedHandlerBase, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate { +public class RadioSwatchGroupBase: SelectorGroupSelectedHandlerBase, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public override var selectorViews: [ModelHandlerType] { + public override var selectorViews: [HandlerType] { didSet { collectionView.reloadData() } @@ -185,7 +185,7 @@ public class RadioSwatchGroupBase: SelectorGr return cell } - open func didSelect(selector: ModelHandlerType) { + open func didSelect(selector: HandlerType) { fatalError("Must override didSelect") } } diff --git a/VDS/PropertyWrappers/AnyProxy.swift b/VDS/PropertyWrappers/AnyProxy.swift deleted file mode 100644 index b504c36d..00000000 --- a/VDS/PropertyWrappers/AnyProxy.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// ProxPropertyWrapper.swift -// VDS -// -// Created by Matt Bruce on 7/29/22. -// - -import Foundation - -//https://www.swiftbysundell.com/articles/accessing-a-swift-property-wrappers-enclosing-instance/ -@propertyWrapper -public struct AnyProxy { - private let keyPath: ReferenceWritableKeyPath - - public init(_ keyPath: ReferenceWritableKeyPath) { - self.keyPath = keyPath - } - - @available(*, unavailable, message: "The wrapped value must be accessed from the enclosing instance property.") - public var wrappedValue: Value { - get { fatalError() } - set { fatalError() } - } - - public static subscript( - _enclosingInstance observed: EnclosingSelf, - wrapped wrappedKeyPath: ReferenceWritableKeyPath, - storage storageKeyPath: ReferenceWritableKeyPath - ) -> Value { - get { - let storageValue = observed[keyPath: storageKeyPath] - let value = observed[keyPath: storageValue.keyPath] - return value - } - set { - let storageValue = observed[keyPath: storageKeyPath] - observed[keyPath: storageValue.keyPath] = newValue - } - } -} - -extension NSObject: ProxyContainer {} -public protocol ProxyContainer { - typealias Proxy = AnyProxy -} diff --git a/VDS/PropertyWrappers/CodableColor.swift b/VDS/PropertyWrappers/CodableColor.swift deleted file mode 100644 index 3b046acc..00000000 --- a/VDS/PropertyWrappers/CodableColor.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// CodableColor.swift -// VDS -// -// Created by Matt Bruce on 8/26/22. -// - -import Foundation -import UIKit - -@propertyWrapper -public struct CodableColor { - public var wrappedValue: UIColor - - public init(wrappedValue: UIColor) { - self.wrappedValue = wrappedValue - } -} - -extension CodableColor: Codable { - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - let colorString = try container.decode(String.self) - wrappedValue = UIColor(hexString: colorString) - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - try container.encode(wrappedValue.hexString) - } -} - -@propertyWrapper -public struct OptionalCodableColor { - public var wrappedValue: UIColor? - - public init(wrappedValue: UIColor?) { - self.wrappedValue = wrappedValue - } -} - -extension OptionalCodableColor: Codable { - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if container.decodeNil() { - wrappedValue = nil - } else { - let colorString = try container.decode(String.self) - wrappedValue = UIColor(hexString: colorString) - } - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - try container.encode(wrappedValue?.hexString) - } -} diff --git a/VDS/PropertyWrappers/Debuggable.swift b/VDS/PropertyWrappers/Debuggable.swift deleted file mode 100644 index 822f6182..00000000 --- a/VDS/PropertyWrappers/Debuggable.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// File.swift -// VDS -// -// Created by Matt Bruce on 8/11/22. -// - -import Foundation - -@propertyWrapper -public struct Debuggable { - private var value: Value - private let description: String - - public init(wrappedValue: Value, description: String = "") { - print("Initialized '\(description)' with value \(wrappedValue)") - self.value = wrappedValue - self.description = description - } - - public var wrappedValue: Value { - get { - print("Accessing '\(description)', returning: \(value)") - return value - } - set { - print("Updating '\(description)', newValue: \(newValue)") - value = newValue - } - } -} diff --git a/VDS/PropertyWrappers/UsesAutoLayout.swift b/VDS/PropertyWrappers/UsesAutoLayout.swift deleted file mode 100644 index 4556a291..00000000 --- a/VDS/PropertyWrappers/UsesAutoLayout.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// UseAutoLayout.swift -// VDS -// -// Created by Matt Bruce on 8/11/22. -// - -import Foundation -import UIKit - -@propertyWrapper -public struct UsesAutoLayout { - public var wrappedValue: T { - didSet { - wrappedValue.translatesAutoresizingMaskIntoConstraints = false - } - } - - public init(wrappedValue: T) { - self.wrappedValue = wrappedValue - wrappedValue.translatesAutoresizingMaskIntoConstraints = false - } -} diff --git a/VDS/Protocols/Accessable.swift b/VDS/Protocols/Accessable.swift index 0b2981fe..75d44fca 100644 --- a/VDS/Protocols/Accessable.swift +++ b/VDS/Protocols/Accessable.swift @@ -18,7 +18,7 @@ public protocol Accessable { } //Configurations to set within the UIControl -extension ModelHandlerable where Self: UIView, Self: Accessable { +extension Handlerable where Self: UIView, Self: Accessable { public func setAccessibilityHint(_ override: Bool? = nil) { let check = override ?? !disabled diff --git a/VDS/Protocols/Colorable.swift b/VDS/Protocols/Colorable.swift index 92a7f461..3c43bf1a 100644 --- a/VDS/Protocols/Colorable.swift +++ b/VDS/Protocols/Colorable.swift @@ -8,15 +8,15 @@ import Foundation import UIKit -public protocol Colorable { - associatedtype ModelType - func getColor(_ viewModel: ModelType) -> UIColor +public protocol Colorable { + associatedtype ObjectType + func getColor(_ object: ObjectType) -> UIColor } extension Colorable { - fileprivate func getColor(_ viewModel: Any) -> UIColor { - guard let model = viewModel as? ModelType else { - assertionFailure("Invalid ModelType, Expecting type \(ModelType.self), received \(viewModel) ") + fileprivate func getColor(_ object: Any) -> UIColor { + guard let model = object as? ObjectType else { + assertionFailure("Invalid ObjectType, Expecting type \(ObjectType.self), received \(object) ") return .black } return getColor(model) @@ -25,15 +25,15 @@ extension Colorable { public func eraseToAnyColorable() -> AnyColorable { AnyColorable(self) } } -public struct GenericColorable: Colorable, Withable { - private var wrapped: any Colorable +public struct GenericColorable: Colorable, Withable { + private var wrapped: any Colorable - public init(colorable: C) where C.ModelType == ModelType { + public init(colorable: C) where C.ObjectType == ObjectType { wrapped = colorable } - public func getColor(_ viewModel: ModelType) -> UIColor { - wrapped.getColor(viewModel) + public func getColor(_ object: ObjectType) -> UIColor { + wrapped.getColor(object) } } @@ -44,7 +44,7 @@ public struct AnyColorable: Colorable, Withable { wrapped = colorable } - public func getColor(_ viewModel: Any) -> UIColor { - wrapped.getColor(viewModel) + public func getColor(_ object: Any) -> UIColor { + wrapped.getColor(object) } } diff --git a/VDS/Protocols/ModelHandlerable.swift b/VDS/Protocols/Handlerable.swift similarity index 64% rename from VDS/Protocols/ModelHandlerable.swift rename to VDS/Protocols/Handlerable.swift index ab6bbcb4..70c2508f 100644 --- a/VDS/Protocols/ModelHandlerable.swift +++ b/VDS/Protocols/Handlerable.swift @@ -1,5 +1,5 @@ // -// Modelable.swift +// Handlerable.swift // VDS // // Created by Matt Bruce on 7/22/22. @@ -9,23 +9,23 @@ import Foundation import Combine import UIKit -public protocol ModelHandlerable: AnyObject, Initable, Disabling, Surfaceable { +public protocol Handlerable: AnyObject, Initable, Disabling, Surfaceable { var subject: PassthroughSubject { get set } var subscribers: Set { get set } func updateView() } -extension ModelHandlerable { +extension Handlerable { public func handlerPublisher() -> AnyPublisher { subject .eraseToAnyPublisher() - .debounce(for: .seconds(Constants.ModelStateDebounce), scheduler: RunLoop.main) + .debounce(for: .seconds(Constants.StateDebounce), scheduler: RunLoop.main) .eraseToAnyPublisher() } } -extension ModelHandlerable where Self: UIView { +extension Handlerable where Self: UIView { public func didChange() { subject.send() setNeedsLayout() diff --git a/VDS/Protocols/Labelable.swift b/VDS/Protocols/Labelable.swift deleted file mode 100644 index f5ff76cc..00000000 --- a/VDS/Protocols/Labelable.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// LabelModelable.swift -// VDS -// -// Created by Matt Bruce on 7/28/22. -// - -import Foundation -import UIKit - -public protocol Labelable { - var typograpicalStyle: TypographicalStyle { get set } - var textPosition: TextPosition { get set } -} - -extension Labelable { - public var font: UIFont? { - return typograpicalStyle.font - } -} diff --git a/VDS/Protocols/Modelable.swift b/VDS/Protocols/Modelable.swift deleted file mode 100644 index 78c5ab6c..00000000 --- a/VDS/Protocols/Modelable.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Modelable.swift -// VDS -// -// Created by Matt Bruce on 8/5/22. -// - -import Foundation - -public protocol Modelable: Surfaceable, Disabling, Initable, Withable, Identifiable, Equatable, CustomDebugStringConvertible where ID == UUID { - -} - -extension Modelable { - public var debugDescription: String { - return "\(id.uuidString)" - } -} diff --git a/VDS/Protocols/Selectable.swift b/VDS/Protocols/Selectable.swift deleted file mode 100644 index fa7777cd..00000000 --- a/VDS/Protocols/Selectable.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// Selectable.swift -// VDS -// -// Created by Matt Bruce on 8/23/22. -// - -import Foundation - -public protocol Selectable { - var selected: Bool { get set } -} diff --git a/VDS/Protocols/SelectorGroupModelable.swift b/VDS/Protocols/SelectorGroupModelable.swift deleted file mode 100644 index 4657b7c6..00000000 --- a/VDS/Protocols/SelectorGroupModelable.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// SelectorGroupModel.swift -// VDS -// -// Created by Matt Bruce on 8/11/22. -// - -import Foundation - -///MARK: Groups that allow anything selected -public protocol SelectorGroupModelable: Modelable, FormFieldable { - associatedtype SelectorModelType: Modelable where SelectorModelType: FormFieldable & Selectable - var selectors: [SelectorModelType] { get set } -} - -extension SelectorGroupModelable { - public var debugDescription: String { - "group id: \(id.uuidString)\r\(selectors.compactMap{"id: \($0.debugDescription) \($0.selected ? "*" : "")"}.joined(separator: "\r"))" - } -} - -///MARK: Groups that allow single selections -public protocol SelectorGroupSelectedModelable: SelectorGroupModelable { - var selectedModel: SelectorModelType? { get } -} - -extension SelectorGroupSelectedModelable { - public var selectedModel: SelectorModelType? { - if let index = selectors.firstIndex(where: { element in - return element.selected == true - }) { - return selectors[index] - } else { - return nil - } - } -}