From 42b57dcd5dd4e5e117cdb9fc6bdf90724e994f0d Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 21 Jan 2020 12:10:48 -0500 Subject: [PATCH] Cleaning --- MVMCoreUI.xcodeproj/project.pbxproj | 202 ++++++------- MVMCoreUI/Atoms/Buttons/ButtonModel.swift | 2 +- MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift | 2 +- MVMCoreUI/Atoms/Buttons/LinkModel.swift | 2 +- .../TextFields}/TextFieldModel.swift | 0 MVMCoreUI/Atoms/Views/CaretViewModel.swift | 2 +- .../Atoms/Views/CircleProgressModel.swift | 6 +- MVMCoreUI/Atoms/Views/DashLineModel.swift | 2 +- .../Views}/DropDownModel.swift | 0 MVMCoreUI/Atoms/Views/{ => Label}/Label.swift | 0 .../LabelAttributeActionModel.swift | 0 .../LabelAttributeColorModel.swift | 0 .../LabelAttributeFontModel.swift | 0 .../LabelAttributeImageModel.swift | 0 .../LabelAttributeModel.swift | 0 .../LabelAttributeStrikeThroughModel.swift | 0 .../LabelAttributeUnderlineModel.swift | 0 .../{LabelModel => Label}/LabelModel.swift | 2 +- .../Molecules => Atoms/Views}/LineModel.swift | 28 +- .../Atoms/Views/MultiProgressModel.swift | 2 +- MVMCoreUI/Atoms/Views/ProgressBarModel.swift | 2 +- MVMCoreUI/Atoms/Views/ToggleModel.swift | 2 +- .../Views/Container/Container.swift | 82 +++++ .../Container/ContainerHelper.swift} | 82 +---- .../Views}/Container/ContainerModel.swift | 2 +- .../Container}/ContainerProtocol.swift | 0 .../Views/EntryFieldContainer.swift | 285 ++++++++++++++++++ .../Views}/MoleculeContainer.swift | 0 .../Views}/MoleculeContainerModel.swift | 6 +- .../Color.swift | 0 .../Views}/ButtonDelegateProtocol.h | 0 .../Views}/MFButtonProtocol.h | 0 .../Buttons => Legacy/Views}/MFCustomButton.h | 0 .../Buttons => Legacy/Views}/MFCustomButton.m | 0 .../Views}/MFDigitTextBox.h | 0 .../Views}/MFDigitTextBox.m | 0 .../Views}/MFDigitTextField.h | 0 .../Views}/MFDigitTextField.m | 0 .../Views}/MFDigitTextField.xib | 0 .../Views/MFLoadingSpinner.h | 0 .../Views/MFLoadingSpinner.m | 0 .../Views}/MFMdnTextField.h | 0 .../Views}/MFMdnTextField.m | 0 .../Buttons => Legacy/Views}/MFTextButton.h | 0 .../Buttons => Legacy/Views}/MFTextButton.m | 0 .../TextFields => Legacy/Views}/MFTextField.h | 0 .../TextFields => Legacy/Views}/MFTextField.m | 0 .../Views}/MFTextField.xib | 0 .../Views}/MFTextFieldSubclassExtension.h | 0 .../{Atoms => Legacy}/Views/MFTextView.h | 0 .../{Atoms => Legacy}/Views/MFTextView.m | 0 .../{Atoms => Legacy}/Views/MFTextView.xib | 0 .../Views}/MVMCoreUIMoleculeViewProtocol.h | 0 .../Views/MVMCoreUIPageControl.h | 0 .../Views/MVMCoreUIPageControl.m | 0 .../Views/MVMCoreUIPagingProtocol.h | 0 .../{Atoms => Legacy}/Views/MVMCoreUISwitch.h | 0 .../{Atoms => Legacy}/Views/MVMCoreUISwitch.m | 0 .../Views/MVMCoreUITextFieldView.h | 0 .../Views/MVMCoreUITextFieldView.m | 0 .../Buttons => Legacy/Views}/PrimaryButton.h | 0 .../Buttons => Legacy/Views}/PrimaryButton.m | 0 .../{Atoms => Legacy}/Views/TextButtonView.h | 0 .../{Atoms => Legacy}/Views/TextButtonView.m | 0 .../Views}/TopLabelsView.h | 0 .../Views}/TopLabelsView.m | 0 .../Views/ViewConstrainingView.h | 0 .../Views/ViewConstrainingView.m | 0 .../ContainerModelProtocol.swift | 0 .../{Models => }/Molecules/FooterModel.swift | 6 +- ...ndardFooterView.swift => FooterView.swift} | 4 +- .../{Models => }/Molecules/HeaderModel.swift | 8 +- ...ndardHeaderView.swift => HeaderView.swift} | 4 +- .../TabsModel.swift | 6 +- .../Items/AccordionListItemModel.swift | 6 +- .../Items/DropDownListItemModel.swift | 6 +- MVMCoreUI/Molecules/Items/ListItemModel.swift | 6 +- .../Items/MoleculeStackItemModel.swift | 6 +- .../Molecules/Items/TabsListItemModel.swift | 6 +- .../LeftRightViews/CornerLabelsModel.swift | 2 +- .../Lists/NumberedListModel.swift | 6 +- .../StringAndMoleculeModel.swift | 2 +- .../Lists/UnOrderedListModel.swift | 6 +- MVMCoreUI/Organisms/MoleculeStackModel.swift | 6 +- MVMCoreUI/Organisms/StackModel.swift | 6 +- .../MVMCoreUIMoleculeMappingObject.m | 4 +- .../ListPageTemplateModel.swift | 2 +- .../StackCenteredPageTemplateModel.swift | 4 - .../StackPageTemplateModel.swift | 4 +- .../ThreeLayerPageTemplateModel.swift | 4 +- MVMCoreUI/Templates/ThreeLayerTemplate.swift | 1 - 91 files changed, 562 insertions(+), 254 deletions(-) rename MVMCoreUI/{Models/Molecules => Atoms/TextFields}/TextFieldModel.swift (100%) rename MVMCoreUI/{Models/Molecules => Atoms/Views}/DropDownModel.swift (100%) rename MVMCoreUI/Atoms/Views/{ => Label}/Label.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelAttributeActionModel.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelAttributeColorModel.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelAttributeFontModel.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelAttributeImageModel.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelAttributeModel.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelAttributeStrikeThroughModel.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelAttributeUnderlineModel.swift (100%) rename MVMCoreUI/Atoms/Views/{LabelModel => Label}/LabelModel.swift (98%) rename MVMCoreUI/{Models/Molecules => Atoms/Views}/LineModel.swift (51%) create mode 100644 MVMCoreUI/Containers/Views/Container/Container.swift rename MVMCoreUI/Containers/{Container.swift => Views/Container/ContainerHelper.swift} (76%) rename MVMCoreUI/{Models => Containers/Views}/Container/ContainerModel.swift (98%) rename MVMCoreUI/Containers/{ => Views/Container}/ContainerProtocol.swift (100%) create mode 100644 MVMCoreUI/Containers/Views/EntryFieldContainer.swift rename MVMCoreUI/{Molecules => Containers/Views}/MoleculeContainer.swift (100%) rename MVMCoreUI/{Models/Container => Containers/Views}/MoleculeContainerModel.swift (77%) rename MVMCoreUI/{Models/Primitive Models => CustomPrimitives}/Color.swift (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/ButtonDelegateProtocol.h (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/MFButtonProtocol.h (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/MFCustomButton.h (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/MFCustomButton.m (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFDigitTextBox.h (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFDigitTextBox.m (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFDigitTextField.h (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFDigitTextField.m (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFDigitTextField.xib (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MFLoadingSpinner.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MFLoadingSpinner.m (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFMdnTextField.h (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFMdnTextField.m (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/MFTextButton.h (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/MFTextButton.m (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFTextField.h (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFTextField.m (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFTextField.xib (100%) rename MVMCoreUI/{Atoms/TextFields => Legacy/Views}/MFTextFieldSubclassExtension.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MFTextView.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MFTextView.m (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MFTextView.xib (100%) rename MVMCoreUI/{Molecules => Legacy/Views}/MVMCoreUIMoleculeViewProtocol.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MVMCoreUIPageControl.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MVMCoreUIPageControl.m (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MVMCoreUIPagingProtocol.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MVMCoreUISwitch.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MVMCoreUISwitch.m (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MVMCoreUITextFieldView.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/MVMCoreUITextFieldView.m (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/PrimaryButton.h (100%) rename MVMCoreUI/{Atoms/Buttons => Legacy/Views}/PrimaryButton.m (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/TextButtonView.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/TextButtonView.m (100%) rename MVMCoreUI/{Molecules => Legacy/Views}/TopLabelsView.h (100%) rename MVMCoreUI/{Molecules => Legacy/Views}/TopLabelsView.m (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/ViewConstrainingView.h (100%) rename MVMCoreUI/{Atoms => Legacy}/Views/ViewConstrainingView.m (100%) rename MVMCoreUI/Models/{Container => ModelProtocols}/ContainerModelProtocol.swift (100%) rename MVMCoreUI/{Models => }/Molecules/FooterModel.swift (87%) rename MVMCoreUI/Molecules/{StandardFooterView.swift => FooterView.swift} (88%) rename MVMCoreUI/{Models => }/Molecules/HeaderModel.swift (86%) rename MVMCoreUI/Molecules/{StandardHeaderView.swift => HeaderView.swift} (96%) rename MVMCoreUI/{Models/Template => Templates}/ListPageTemplateModel.swift (98%) rename MVMCoreUI/{Models/Template => Templates}/StackCenteredPageTemplateModel.swift (99%) rename MVMCoreUI/{Models/Template => Templates}/StackPageTemplateModel.swift (97%) rename MVMCoreUI/{Models/Template => Templates}/ThreeLayerPageTemplateModel.swift (97%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 11ba168e..2ae882f5 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -148,7 +148,7 @@ D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368A23609801006832FA /* MoleculeStackItemModel.swift */; }; D268C70E238C22D7007F2C1C /* DropDownFilterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D268C70D238C22D7007F2C1C /* DropDownFilterTableViewCell.swift */; }; D268C712238D6699007F2C1C /* DropDown.swift in Sources */ = {isa = PBXBuildFile; fileRef = D268C711238D6699007F2C1C /* DropDown.swift */; }; - D274CA332236A78900B01B62 /* StandardFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D274CA322236A78900B01B62 /* StandardFooterView.swift */; }; + D274CA332236A78900B01B62 /* FooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D274CA322236A78900B01B62 /* FooterView.swift */; }; D2755D7B23689C7500485468 /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2755D7A23689C7500485468 /* TableViewCell.swift */; }; D27CD40E2322EEAF00C1DC07 /* TabsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D27CD40D2322EEAF00C1DC07 /* TabsTableViewCell.swift */; }; D27CD4102339057800C1DC07 /* EyebrowHeadlineBodyLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = D27CD40F2339057800C1DC07 /* EyebrowHeadlineBodyLink.swift */; }; @@ -274,13 +274,14 @@ D29DF32E21EE8C3D003B2FB9 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D29DF32D21EE8C3D003B2FB9 /* Media.xcassets */; }; D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28D723D21AB800ACEA85 /* StringAndMoleculeView.swift */; }; D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28D923D21AFA00ACEA85 /* StringAndMoleculeModel.swift */; }; + D29E28DD23D7404C00ACEA85 /* ContainerHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */; }; D2A514582211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D2A514562211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; D2A514592211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A514572211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m */; }; D2A5145D2211D22A00345BFB /* MVMCoreUIMoleculeViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D2A5145C2211D22A00345BFB /* MVMCoreUIMoleculeViewProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; D2A5145F2211DDC100345BFB /* MoleculeStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5145E2211DDC100345BFB /* MoleculeStackView.swift */; }; D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */; }; D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */; }; - D2A514672213885800345BFB /* StandardHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514662213885800345BFB /* StandardHeaderView.swift */; }; + D2A514672213885800345BFB /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514662213885800345BFB /* HeaderView.swift */; }; D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */; }; D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A638FC22CA98280052ED1F /* HeadlineBody.swift */; }; D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390022CBB1820052ED1F /* Carousel.swift */; }; @@ -438,7 +439,7 @@ D260D7B522D68509007E7233 /* MVMCoreUIPagingProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIPagingProtocol.h; sourceTree = ""; }; D268C70D238C22D7007F2C1C /* DropDownFilterTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DropDownFilterTableViewCell.swift; sourceTree = ""; }; D268C711238D6699007F2C1C /* DropDown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropDown.swift; sourceTree = ""; }; - D274CA322236A78900B01B62 /* StandardFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardFooterView.swift; sourceTree = ""; }; + D274CA322236A78900B01B62 /* FooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooterView.swift; sourceTree = ""; }; D2755D7A23689C7500485468 /* TableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = ""; }; D27CD40D2322EEAF00C1DC07 /* TabsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabsTableViewCell.swift; sourceTree = ""; }; D27CD40F2339057800C1DC07 /* EyebrowHeadlineBodyLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EyebrowHeadlineBodyLink.swift; sourceTree = ""; }; @@ -579,13 +580,14 @@ D29DF32D21EE8C3D003B2FB9 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; D29E28D723D21AB800ACEA85 /* StringAndMoleculeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeView.swift; sourceTree = ""; }; D29E28D923D21AFA00ACEA85 /* StringAndMoleculeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeModel.swift; sourceTree = ""; }; + D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerHelper.swift; sourceTree = ""; }; D2A514562211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIMoleculeMappingObject.h; sourceTree = ""; }; D2A514572211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIMoleculeMappingObject.m; sourceTree = ""; }; D2A5145C2211D22A00345BFB /* MVMCoreUIMoleculeViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIMoleculeViewProtocol.h; sourceTree = ""; }; D2A5145E2211DDC100345BFB /* MoleculeStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackView.swift; sourceTree = ""; }; D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackTemplate.swift; sourceTree = ""; }; D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackCenteredTemplate.swift; sourceTree = ""; }; - D2A514662213885800345BFB /* StandardHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardHeaderView.swift; sourceTree = ""; }; + D2A514662213885800345BFB /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = ""; }; D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerViewController.swift; sourceTree = ""; }; D2A638FC22CA98280052ED1F /* HeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBody.swift; sourceTree = ""; }; D2A6390022CBB1820052ED1F /* Carousel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carousel.swift; sourceTree = ""; }; @@ -629,6 +631,7 @@ 011B58EE23A2AA850085F53C /* ModelProtocols */ = { isa = PBXGroup; children = ( + 014AA72323C501E2006F3E93 /* ContainerModelProtocol.swift */, 017BEB4123620AD20024EF95 /* FormModelProtocol.swift */, 012A88C3238D86E600FE3DA1 /* CollectionCellMoleculeProtocol.swift */, 012A88B0238C880100FE3DA1 /* PagingMoleculeProtocol.swift */, @@ -641,42 +644,18 @@ path = ModelProtocols; sourceTree = ""; }; - 012A88EF23985E0100FE3DA1 /* Primitive Models */ = { + 012A88EF23985E0100FE3DA1 /* CustomPrimitives */ = { isa = PBXGroup; children = ( 012A88F023985E0100FE3DA1 /* Color.swift */, ); - path = "Primitive Models"; - sourceTree = ""; - }; - 014AA72023C501E2006F3E93 /* Container */ = { - isa = PBXGroup; - children = ( - 014AA72123C501E2006F3E93 /* MoleculeContainerModel.swift */, - 014AA72223C501E2006F3E93 /* ContainerModel.swift */, - 014AA72323C501E2006F3E93 /* ContainerModelProtocol.swift */, - ); - path = Container; - sourceTree = ""; - }; - 014AA72723C5059B006F3E93 /* Template */ = { - isa = PBXGroup; - children = ( - 014AA72823C5059B006F3E93 /* StackPageTemplateModel.swift */, - 014AA72923C5059B006F3E93 /* StackCenteredPageTemplateModel.swift */, - 014AA72A23C5059B006F3E93 /* ThreeLayerPageTemplateModel.swift */, - 014AA72C23C5059B006F3E93 /* ListPageTemplateModel.swift */, - ); - path = Template; + path = CustomPrimitives; sourceTree = ""; }; 01509D96232803B200EF99AA /* Models */ = { isa = PBXGroup; children = ( - 014AA72723C5059B006F3E93 /* Template */, - 014AA72023C501E2006F3E93 /* Container */, 011B58EE23A2AA850085F53C /* ModelProtocols */, - 012A88EF23985E0100FE3DA1 /* Primitive Models */, 946EE1B5237B663A0036751F /* Extensions */, 01EB368723609801006832FA /* Molecules */, ); @@ -697,11 +676,6 @@ 01EB368723609801006832FA /* Molecules */ = { isa = PBXGroup; children = ( - 011B58F323A2CCC80085F53C /* DropDownModel.swift */, - 01EB368C23609801006832FA /* HeaderModel.swift */, - 012A88EB238F084D00FE3DA1 /* FooterModel.swift */, - 017BEB3F23620A230024EF95 /* TextFieldModel.swift */, - 017BEB7A236763000024EF95 /* LineModel.swift */, 012A88AE238C626E00FE3DA1 /* CarouselModel.swift */, 012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */, 012A88C5238DA34000FE3DA1 /* ModuleMoleculeModel.swift */, @@ -717,12 +691,15 @@ path = Protocols; sourceTree = ""; }; - 0ABD1369237B18EE0081388D /* views */ = { + 0ABD1369237B18EE0081388D /* Views */ = { isa = PBXGroup; children = ( + D29E28DE23D740FC00ACEA85 /* Container */, 0ABD136A237B193A0081388D /* EntryFieldContainer.swift */, + 014AA72123C501E2006F3E93 /* MoleculeContainerModel.swift */, + D2FB151A23A2B65B00C20E10 /* MoleculeContainer.swift */, ); - path = views; + path = Views; sourceTree = ""; }; 946EE1B5237B663A0036751F /* Extensions */ = { @@ -733,7 +710,7 @@ path = Extensions; sourceTree = ""; }; - 94C2D9822386F3E30006CF46 /* LabelModel */ = { + 94C2D9822386F3E30006CF46 /* Label */ = { isa = PBXGroup; children = ( 01EB368823609801006832FA /* LabelModel.swift */, @@ -744,8 +721,9 @@ 94C2D9A623872DA90006CF46 /* LabelAttributeColorModel.swift */, 94C2D9A823872E5E0006CF46 /* LabelAttributeImageModel.swift */, 94C2D9AA23872EB50006CF46 /* LabelAttributeActionModel.swift */, + DB891E822253FA8500022516 /* Label.swift */, ); - path = LabelModel; + path = Label; sourceTree = ""; }; 94FB5B83238D892800EB2193 /* Recovered References */ = { @@ -783,6 +761,44 @@ D22D1F19220341F50077CEC0 /* MVMCoreUICheckBox.m */, 0198F7A02256A80A0066C936 /* MFRadioButton.h */, 0198F7A22256A80A0066C936 /* MFRadioButton.m */, + D29DF28721E7AC2B003B2FB9 /* ViewConstrainingView.h */, + D29DF28821E7AC2B003B2FB9 /* ViewConstrainingView.m */, + D29DF2AD21E7B3A4003B2FB9 /* MFTextView.h */, + D29DF2AB21E7B3A4003B2FB9 /* MFTextView.m */, + D29DF2AC21E7B3A4003B2FB9 /* MFTextView.xib */, + D29DF2B121E7B76C003B2FB9 /* MFLoadingSpinner.h */, + D29DF2B221E7B76D003B2FB9 /* MFLoadingSpinner.m */, + D29DF32321ED0DA2003B2FB9 /* TextButtonView.h */, + D29DF32221ED0DA2003B2FB9 /* TextButtonView.m */, + D29770FB21F7C77400B2F0D0 /* MVMCoreUITextFieldView.h */, + D29770FA21F7C77400B2F0D0 /* MVMCoreUITextFieldView.m */, + D22D1F44220496A30077CEC0 /* MVMCoreUISwitch.h */, + D22D1F45220496A30077CEC0 /* MVMCoreUISwitch.m */, + D29DF16A21E69E1F003B2FB9 /* MFCustomButton.h */, + D29DF17021E69E1F003B2FB9 /* MFCustomButton.m */, + D29DF16D21E69E1F003B2FB9 /* MFTextButton.h */, + D29DF17221E69E1F003B2FB9 /* MFTextButton.m */, + D29DF16C21E69E1F003B2FB9 /* PrimaryButton.h */, + D29DF17121E69E1F003B2FB9 /* PrimaryButton.m */, + D29DF25821E6A22D003B2FB9 /* MFButtonProtocol.h */, + D29DF16B21E69E1F003B2FB9 /* ButtonDelegateProtocol.h */, + D260D7AF22D65BDD007E7233 /* MVMCoreUIPageControl.h */, + D260D7B022D65BDD007E7233 /* MVMCoreUIPageControl.m */, + D260D7B522D68509007E7233 /* MVMCoreUIPagingProtocol.h */, + D29DF24C21E6A177003B2FB9 /* MFTextField.h */, + D29DF24221E6A176003B2FB9 /* MFTextField.m */, + D29DF24421E6A176003B2FB9 /* MFTextField.xib */, + D29DF24B21E6A177003B2FB9 /* MFTextFieldSubclassExtension.h */, + D29DF24721E6A176003B2FB9 /* MFMdnTextField.h */, + D29DF24921E6A177003B2FB9 /* MFMdnTextField.m */, + D29DF24521E6A176003B2FB9 /* MFDigitTextBox.h */, + D29DF24621E6A176003B2FB9 /* MFDigitTextBox.m */, + D29DF24321E6A176003B2FB9 /* MFDigitTextField.h */, + D29DF24821E6A177003B2FB9 /* MFDigitTextField.m */, + D29DF24A21E6A177003B2FB9 /* MFDigitTextField.xib */, + D2A5145C2211D22A00345BFB /* MVMCoreUIMoleculeViewProtocol.h */, + D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */, + D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */, ); path = Views; sourceTree = ""; @@ -791,8 +807,8 @@ isa = PBXGroup; children = ( 01509D942327ED1900EF99AA /* HeadlineBodyTextButtonSwitch.swift */, - D22479892314445E003FCCF9 /* LabelSwitch.swift */, 01C851D223CF9E740021F976 /* LabelToggleModel.swift */, + D22479892314445E003FCCF9 /* LabelSwitch.swift */, D224798B231450C8003FCCF9 /* HeadlineBodySwitch.swift */, ); path = SwitchMolecules; @@ -802,8 +818,8 @@ isa = PBXGroup; children = ( D29E28D423D1FFFA00ACEA85 /* Lists */, - D2A638FC22CA98280052ED1F /* HeadlineBody.swift */, 01EB368D23609801006832FA /* HeadlineBodyModel.swift */, + D2A638FC22CA98280052ED1F /* HeadlineBody.swift */, D22479952316AF6D003FCCF9 /* HeadlineBodyTextButton.swift */, D27CD40F2339057800C1DC07 /* EyebrowHeadlineBodyLink.swift */, D28A839223CE828900DFE4FC /* HeadlineBodyCaretLinkImageModel.swift */, @@ -850,8 +866,8 @@ isa = PBXGroup; children = ( D2755D7A23689C7500485468 /* TableViewCell.swift */, - 01509D8E2327EC6F00EF99AA /* MoleculeTableViewCell.swift */, 01EB368923609801006832FA /* ListItemModel.swift */, + 01509D8E2327EC6F00EF99AA /* MoleculeTableViewCell.swift */, D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */, D28A838023CCB0D800DFE4FC /* AccordionListItemModel.swift */, D224799A231965AD003FCCF9 /* AccordionMoleculeTableViewCell.swift */, @@ -909,6 +925,7 @@ isa = PBXGroup; children = ( 01509D96232803B200EF99AA /* Models */, + 012A88EF23985E0100FE3DA1 /* CustomPrimitives */, D2B18B7D236090D500A9AEDC /* BaseClasses */, 01C74D87224298E2009C25A3 /* FormUIHelpers */, D29DF31421ECECA7003B2FB9 /* SupportingFiles */, @@ -933,10 +950,14 @@ D29DF0DF21E418B2003B2FB9 /* Templates */ = { isa = PBXGroup; children = ( + 014AA72823C5059B006F3E93 /* StackPageTemplateModel.swift */, D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */, + 014AA72923C5059B006F3E93 /* StackCenteredPageTemplateModel.swift */, D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */, D28A837A23C928DA00DFE4FC /* MoleculeListCellProtocol.swift */, + 014AA72C23C5059B006F3E93 /* ListPageTemplateModel.swift */, D2E1FAE02268E81D00AEFD8C /* MoleculeListTemplate.swift */, + 014AA72A23C5059B006F3E93 /* ThreeLayerPageTemplateModel.swift */, D2D6CD4122E78FAB00D701B8 /* ThreeLayerTemplate.swift */, ); path = Templates; @@ -968,19 +989,17 @@ D224798F2316A99F003FCCF9 /* LeftRightViews */, D224798E2316A995003FCCF9 /* HorizontalCombinationViews */, D224798D2316A988003FCCF9 /* VerticalCombinationViews */, - D2A5145C2211D22A00345BFB /* MVMCoreUIMoleculeViewProtocol.h */, 0A12149F22C11A17007C7030 /* ActionDetailWithImage.swift */, - D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */, - D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */, - D2A514662213885800345BFB /* StandardHeaderView.swift */, - D274CA322236A78900B01B62 /* StandardFooterView.swift */, + 01EB368C23609801006832FA /* HeaderModel.swift */, + D2A514662213885800345BFB /* HeaderView.swift */, + 012A88EB238F084D00FE3DA1 /* FooterModel.swift */, + D274CA322236A78900B01B62 /* FooterView.swift */, 0116A4E4228B19640094F3ED /* RadioButtonModel.swift */, D29B770F22C281F400D6ACE0 /* ModuleMolecule.swift */, D28A838423CCCA8900DFE4FC /* ScrollerModel.swift */, D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */, 0A7BAD73232A8DC700FB8E22 /* HeadlineBodyButton.swift */, 017BEB372360C6AC0024EF95 /* RadioButtonLabel.swift */, - D2FB151A23A2B65B00C20E10 /* MoleculeContainer.swift */, 017BEB47236230DB0024EF95 /* MoleculeViewProtocol.swift */, 017BEB49236235BA0024EF95 /* ModelMoleculeViewProtocol.swift */, D260105723CF9CC500764D80 /* Doughnut */, @@ -1027,12 +1046,10 @@ D29DF11921E68467003B2FB9 /* Containers */ = { isa = PBXGroup; children = ( - 0ABD1369237B18EE0081388D /* views */, + 0ABD1369237B18EE0081388D /* Views */, D29DF2B721E7BE79003B2FB9 /* TabBarController */, D29DF2B621E7BE66003B2FB9 /* SplitViewController */, D2B18B93236214AD00A9AEDC /* NavigationController.swift */, - D260105823D0A92900764D80 /* ContainerProtocol.swift */, - D243859823A16B1800332775 /* Container.swift */, ); path = Containers; sourceTree = ""; @@ -1096,22 +1113,14 @@ D29DF16821E69E1F003B2FB9 /* Buttons */ = { isa = PBXGroup; children = ( - DBC4391A224421A0001AB423 /* CaretButton.swift */, 01F2A03123A4498200D954D8 /* CaretLinkModel.swift */, - D29DF25821E6A22D003B2FB9 /* MFButtonProtocol.h */, - D29DF16B21E69E1F003B2FB9 /* ButtonDelegateProtocol.h */, - D29DF16A21E69E1F003B2FB9 /* MFCustomButton.h */, - D29DF17021E69E1F003B2FB9 /* MFCustomButton.m */, - D28A837623C79FC600DFE4FC /* MFCustomButton+ActionModel.swift */, + DBC4391A224421A0001AB423 /* CaretButton.swift */, D28A838A23CCDA6B00DFE4FC /* ButtonModel.swift */, - D28A838C23CCDCC200DFE4FC /* PrimaryButton+MoleculeProtocolExtension.swift */, - D29DF16C21E69E1F003B2FB9 /* PrimaryButton.h */, - D29DF17121E69E1F003B2FB9 /* PrimaryButton.m */, D282AACA2243C61700C46919 /* ButtonView.swift */, D28A838823CCCFCB00DFE4FC /* LinkModel.swift */, + D28A838C23CCDCC200DFE4FC /* PrimaryButton+MoleculeProtocolExtension.swift */, D28A838623CCCF6500DFE4FC /* MFTextButton+ModelExtension.swift */, - D29DF16D21E69E1F003B2FB9 /* MFTextButton.h */, - D29DF17221E69E1F003B2FB9 /* MFTextButton.m */, + D28A837623C79FC600DFE4FC /* MFCustomButton+ActionModel.swift */, ); path = Buttons; sourceTree = ""; @@ -1119,50 +1128,35 @@ D29DF17D21E69E26003B2FB9 /* Views */ = { isa = PBXGroup; children = ( - 01509D922327ECFB00EF99AA /* ProgressBar.swift */, 9445890B2385BCE300DE9FD4 /* ProgressBarModel.swift */, - D260D7AF22D65BDD007E7233 /* MVMCoreUIPageControl.h */, - D260D7B022D65BDD007E7233 /* MVMCoreUIPageControl.m */, - D260D7B522D68509007E7233 /* MVMCoreUIPagingProtocol.h */, - 948DB67D2326DCD90011F916 /* MultiProgress.swift */, + 01509D922327ECFB00EF99AA /* ProgressBar.swift */, 9445890D2385C3F800DE9FD4 /* MultiProgressModel.swift */, - DBC4391622442196001AB423 /* CaretView.swift */, + 948DB67D2326DCD90011F916 /* MultiProgress.swift */, 9445891E2385D2E900DE9FD4 /* CaretViewModel.swift */, - DBC4391722442197001AB423 /* DashLine.swift */, + DBC4391622442196001AB423 /* CaretView.swift */, 944589202385D6E900DE9FD4 /* DashLineModel.swift */, - DB06250A2293456500B72DD3 /* LeftRightLabelView.swift */, + DBC4391722442197001AB423 /* DashLine.swift */, 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */, - 012CA99D2385A2D3003F810F /* MFView+ModelExtension.swift */, - D29DF28721E7AC2B003B2FB9 /* ViewConstrainingView.h */, - D29DF28821E7AC2B003B2FB9 /* ViewConstrainingView.m */, + DB06250A2293456500B72DD3 /* LeftRightLabelView.swift */, D282AAB9224131D100C46919 /* MFTransparentGIFView.swift */, - D282AAB3223FDDAE00C46919 /* MFLoadImageView.swift */, 944589222385DA9500DE9FD4 /* ImageViewModel.swift */, + D282AAB3223FDDAE00C46919 /* MFLoadImageView.swift */, + 017BEB7A236763000024EF95 /* LineModel.swift */, D213347623843825008E41B3 /* Line.swift */, - D29DF2AD21E7B3A4003B2FB9 /* MFTextView.h */, - D29DF2AB21E7B3A4003B2FB9 /* MFTextView.m */, - D29DF2AC21E7B3A4003B2FB9 /* MFTextView.xib */, + 011B58F323A2CCC80085F53C /* DropDownModel.swift */, D268C711238D6699007F2C1C /* DropDown.swift */, - D29DF2B121E7B76C003B2FB9 /* MFLoadingSpinner.h */, - D29DF2B221E7B76D003B2FB9 /* MFLoadingSpinner.m */, - D29DF32321ED0DA2003B2FB9 /* TextButtonView.h */, - D29DF32221ED0DA2003B2FB9 /* TextButtonView.m */, - D29770FB21F7C77400B2F0D0 /* MVMCoreUITextFieldView.h */, - D29770FA21F7C77400B2F0D0 /* MVMCoreUITextFieldView.m */, - D260105223CEA61600764D80 /* ToggleModel.swift */, - D260105423CEA7DC00764D80 /* MVMCoreUISwitch+Model.swift */, - D22D1F44220496A30077CEC0 /* MVMCoreUISwitch.h */, - D22D1F45220496A30077CEC0 /* MVMCoreUISwitch.m */, DBC4391C2245232D001AB423 /* LabelWithInternalButton.swift */, - DB891E822253FA8500022516 /* Label.swift */, - 94C2D9822386F3E30006CF46 /* LabelModel */, + 94C2D9822386F3E30006CF46 /* Label */, 0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */, 0A7BAFA2232BE63400FB8E22 /* CheckboxWithLabelView.swift */, 01004F2F22721C3800991ECC /* RadioButton.swift */, D28A838223CCBD3F00DFE4FC /* CircleProgressModel.swift */, 943784F3236B77BB006A1E82 /* GraphView.swift */, 943784F4236B77BB006A1E82 /* GraphViewAnimationHandler.swift */, + D260105223CEA61600764D80 /* ToggleModel.swift */, 0AA33B392398524F0067DD0F /* Toggle.swift */, + D260105423CEA7DC00764D80 /* MVMCoreUISwitch+Model.swift */, + 012CA99D2385A2D3003F810F /* MFView+ModelExtension.swift */, ); path = Views; sourceTree = ""; @@ -1170,18 +1164,7 @@ D29DF22B21E6A0FA003B2FB9 /* TextFields */ = { isa = PBXGroup; children = ( - D29DF24C21E6A177003B2FB9 /* MFTextField.h */, - D29DF24221E6A176003B2FB9 /* MFTextField.m */, - 012CA9992384A687003F810F /* MFTextField+ModelExtension.swift */, - D29DF24421E6A176003B2FB9 /* MFTextField.xib */, - D29DF24B21E6A177003B2FB9 /* MFTextFieldSubclassExtension.h */, - D29DF24721E6A176003B2FB9 /* MFMdnTextField.h */, - D29DF24921E6A177003B2FB9 /* MFMdnTextField.m */, - D29DF24521E6A176003B2FB9 /* MFDigitTextBox.h */, - D29DF24621E6A176003B2FB9 /* MFDigitTextBox.m */, - D29DF24321E6A176003B2FB9 /* MFDigitTextField.h */, - D29DF24821E6A177003B2FB9 /* MFDigitTextField.m */, - D29DF24A21E6A177003B2FB9 /* MFDigitTextField.xib */, + 017BEB3F23620A230024EF95 /* TextFieldModel.swift */, 0A41BA7E23453A6400D4C0BC /* TextEntryField.swift */, 0A8321AE2355FE9500CB7F00 /* DigitBox.swift */, 0A21DB7E235DECC500C160A2 /* EntryField.swift */, @@ -1190,6 +1173,7 @@ 0A6BF4712360C56C0028F841 /* BaseDropdownEntryField.swift */, 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */, 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */, + 012CA9992384A687003F810F /* MFTextField+ModelExtension.swift */, ); path = TextFields; sourceTree = ""; @@ -1313,6 +1297,17 @@ path = StringAndMoleculeStack; sourceTree = ""; }; + D29E28DE23D740FC00ACEA85 /* Container */ = { + isa = PBXGroup; + children = ( + 014AA72223C501E2006F3E93 /* ContainerModel.swift */, + D260105823D0A92900764D80 /* ContainerProtocol.swift */, + D243859823A16B1800332775 /* Container.swift */, + D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */, + ); + path = Container; + sourceTree = ""; + }; D2B18B7D236090D500A9AEDC /* BaseClasses */ = { isa = PBXGroup; children = ( @@ -1556,7 +1551,7 @@ D28A837723C79FC600DFE4FC /* MFCustomButton+ActionModel.swift in Sources */, D28A837F23CCA96400DFE4FC /* TabsModel.swift in Sources */, 012A88EC238F084D00FE3DA1 /* FooterModel.swift in Sources */, - D2A514672213885800345BFB /* StandardHeaderView.swift in Sources */, + D2A514672213885800345BFB /* HeaderView.swift in Sources */, D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */, 01EB369023609801006832FA /* ListItemModel.swift in Sources */, D28A838323CCBD3F00DFE4FC /* CircleProgressModel.swift in Sources */, @@ -1598,7 +1593,7 @@ 017BEB7B236763000024EF95 /* LineModel.swift in Sources */, 94C2D9A523872C350006CF46 /* LabelAttributeFontModel.swift in Sources */, 017BEB7F23676E870024EF95 /* MoleculeObjectMapping.swift in Sources */, - D274CA332236A78900B01B62 /* StandardFooterView.swift in Sources */, + D274CA332236A78900B01B62 /* FooterView.swift in Sources */, D29DF2BF21E7BEA4003B2FB9 /* MVMCoreUITabBarPageControlViewController.m in Sources */, 014AA72423C501E2006F3E93 /* MoleculeContainerModel.swift in Sources */, D29DF28321E7AB24003B2FB9 /* MVMCoreUICommonViewsUtility.m in Sources */, @@ -1686,6 +1681,7 @@ D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */, C695A69423C9909000BFB94E /* DoughnutChartModel.swift in Sources */, D29DF32421ED0DA2003B2FB9 /* TextButtonView.m in Sources */, + D29E28DD23D7404C00ACEA85 /* ContainerHelper.swift in Sources */, 012A88C2238D7BCA00FE3DA1 /* CarouselItemModel.swift in Sources */, D29DF29E21E7AE3B003B2FB9 /* MFStyler.m in Sources */, D2A514592211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m in Sources */, diff --git a/MVMCoreUI/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atoms/Buttons/ButtonModel.swift index b480aa2c..26efc82e 100644 --- a/MVMCoreUI/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atoms/Buttons/ButtonModel.swift @@ -33,7 +33,7 @@ public class ButtonModel: MoleculeProtocol { self.action = action } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor case title case action diff --git a/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift b/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift index b2fc5841..6daf2740 100644 --- a/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift +++ b/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift @@ -23,7 +23,7 @@ public class CaretLinkModel: MoleculeProtocol { self.action = action } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor case title case action diff --git a/MVMCoreUI/Atoms/Buttons/LinkModel.swift b/MVMCoreUI/Atoms/Buttons/LinkModel.swift index e2fca66c..fd0b17b9 100644 --- a/MVMCoreUI/Atoms/Buttons/LinkModel.swift +++ b/MVMCoreUI/Atoms/Buttons/LinkModel.swift @@ -21,7 +21,7 @@ public class LinkModel: MoleculeProtocol { self.action = action } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor case title case action diff --git a/MVMCoreUI/Models/Molecules/TextFieldModel.swift b/MVMCoreUI/Atoms/TextFields/TextFieldModel.swift similarity index 100% rename from MVMCoreUI/Models/Molecules/TextFieldModel.swift rename to MVMCoreUI/Atoms/TextFields/TextFieldModel.swift diff --git a/MVMCoreUI/Atoms/Views/CaretViewModel.swift b/MVMCoreUI/Atoms/Views/CaretViewModel.swift index f26a150f..cee09a40 100644 --- a/MVMCoreUI/Atoms/Views/CaretViewModel.swift +++ b/MVMCoreUI/Atoms/Views/CaretViewModel.swift @@ -17,7 +17,7 @@ import Foundation public var isOpaque: Bool? public var lineWidth: CGFloat? - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor case strokeColor case isHidden diff --git a/MVMCoreUI/Atoms/Views/CircleProgressModel.swift b/MVMCoreUI/Atoms/Views/CircleProgressModel.swift index 20f49dc0..aae99612 100644 --- a/MVMCoreUI/Atoms/Views/CircleProgressModel.swift +++ b/MVMCoreUI/Atoms/Views/CircleProgressModel.swift @@ -38,7 +38,7 @@ public class CircleProgressModel: MoleculeProtocol { public init() {} - enum CircleProgressCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case style case size case diameter @@ -50,7 +50,7 @@ public class CircleProgressModel: MoleculeProtocol { } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CircleProgressCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) if let style = try typeContainer.decodeIfPresent(GraphStyle.self, forKey: .style) { self.style = style } @@ -76,7 +76,7 @@ public class CircleProgressModel: MoleculeProtocol { } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CircleProgressCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(style, forKey: .style) try container.encode(size, forKey: .size) try container.encode(diameter, forKey: .diameter) diff --git a/MVMCoreUI/Atoms/Views/DashLineModel.swift b/MVMCoreUI/Atoms/Views/DashLineModel.swift index ec6b8a15..662a7cf4 100644 --- a/MVMCoreUI/Atoms/Views/DashLineModel.swift +++ b/MVMCoreUI/Atoms/Views/DashLineModel.swift @@ -19,7 +19,7 @@ import Foundation self.dashColor = dashColor } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor case dashColor case isHidden diff --git a/MVMCoreUI/Models/Molecules/DropDownModel.swift b/MVMCoreUI/Atoms/Views/DropDownModel.swift similarity index 100% rename from MVMCoreUI/Models/Molecules/DropDownModel.swift rename to MVMCoreUI/Atoms/Views/DropDownModel.swift diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label/Label.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/Label.swift rename to MVMCoreUI/Atoms/Views/Label/Label.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeActionModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeActionModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeColorModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeColorModel.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeColorModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelAttributeColorModel.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeFontModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeFontModel.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeFontModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelAttributeFontModel.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeImageModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeImageModel.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeImageModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelAttributeImageModel.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeModel.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelAttributeModel.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeStrikeThroughModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeStrikeThroughModel.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeStrikeThroughModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelAttributeStrikeThroughModel.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeUnderlineModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeUnderlineModel.swift similarity index 100% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelAttributeUnderlineModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelAttributeUnderlineModel.swift diff --git a/MVMCoreUI/Atoms/Views/LabelModel/LabelModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelModel.swift similarity index 98% rename from MVMCoreUI/Atoms/Views/LabelModel/LabelModel.swift rename to MVMCoreUI/Atoms/Views/Label/LabelModel.swift index 90c694a0..faf19c22 100644 --- a/MVMCoreUI/Atoms/Views/LabelModel/LabelModel.swift +++ b/MVMCoreUI/Atoms/Views/Label/LabelModel.swift @@ -26,7 +26,7 @@ import Foundation public var hero: Int? public var makeWholeViewClickable: Bool? - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case text case accessibilityText diff --git a/MVMCoreUI/Models/Molecules/LineModel.swift b/MVMCoreUI/Atoms/Views/LineModel.swift similarity index 51% rename from MVMCoreUI/Models/Molecules/LineModel.swift rename to MVMCoreUI/Atoms/Views/LineModel.swift index 88e09be0..cf671996 100644 --- a/MVMCoreUI/Models/Molecules/LineModel.swift +++ b/MVMCoreUI/Atoms/Views/LineModel.swift @@ -41,11 +41,37 @@ import UIKit } public static var identifier: String = "line" - public var type: Style? = .standard + public var type: Style = .standard public var frequency: Frequency? = .allExceptTop public var backgroundColor: Color? public init(type: Style) { self.type = type } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case type + case backgroundColor + case frequency + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + if let type = try typeContainer.decodeIfPresent(Style.self, forKey: .type) { + self.type = type + } + if let frequency = try typeContainer.decodeIfPresent(Frequency.self, forKey: .frequency) { + self.frequency = frequency + } + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(type, forKey: .type) + try container.encodeIfPresent(frequency, forKey: .frequency) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + } } diff --git a/MVMCoreUI/Atoms/Views/MultiProgressModel.swift b/MVMCoreUI/Atoms/Views/MultiProgressModel.swift index 497fc9d5..abcbd5fd 100644 --- a/MVMCoreUI/Atoms/Views/MultiProgressModel.swift +++ b/MVMCoreUI/Atoms/Views/MultiProgressModel.swift @@ -25,7 +25,7 @@ import Foundation public var thickness: CGFloat? public var roundedRect: Bool? - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case progressList case thickness case roundedRect diff --git a/MVMCoreUI/Atoms/Views/ProgressBarModel.swift b/MVMCoreUI/Atoms/Views/ProgressBarModel.swift index 1850c411..396ab8e9 100644 --- a/MVMCoreUI/Atoms/Views/ProgressBarModel.swift +++ b/MVMCoreUI/Atoms/Views/ProgressBarModel.swift @@ -16,7 +16,7 @@ import Foundation public var isRounded: Bool? public var thickness: CGFloat? - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case isRounded = "roundRect" case thickness diff --git a/MVMCoreUI/Atoms/Views/ToggleModel.swift b/MVMCoreUI/Atoms/Views/ToggleModel.swift index 81602c2a..8aa9500b 100644 --- a/MVMCoreUI/Atoms/Views/ToggleModel.swift +++ b/MVMCoreUI/Atoms/Views/ToggleModel.swift @@ -17,7 +17,7 @@ public class ToggleModel: MoleculeProtocol { public var required: Bool? public var fieldKey: String? - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case state case action diff --git a/MVMCoreUI/Containers/Views/Container/Container.swift b/MVMCoreUI/Containers/Views/Container/Container.swift new file mode 100644 index 00000000..065490a0 --- /dev/null +++ b/MVMCoreUI/Containers/Views/Container/Container.swift @@ -0,0 +1,82 @@ +// +// Container.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 12/11/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +import UIKit + +open class Container: View, ContainerProtocol { + public var view: UIView? + let containerHelper = ContainerHelper() + var containerModel: ContainerModelProtocol? { + get { return model as? ContainerModelProtocol } + } + + // MARK:- ModelMoleculeViewProtocol + override open func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.setWithModel(model, delegateObject, additionalData) + guard let containerModel = model as? ContainerModelProtocol else { return } + containerHelper.set(with: containerModel, for: view as? MVMCoreUIViewConstrainingProtocol) + } + + // MARK:- ContainerProtocol + public func alignHorizontal(_ alignment: UIStackView.Alignment) { + containerHelper.alignHorizontal(alignment) + } + + public func alignVertical(_ alignment: UIStackView.Alignment) { + containerHelper.alignVertical(alignment) + } + + public func constrainView(_ view: UIView) { + containerHelper.constrainView(view) + } +} + +// MARK: - MVMCoreViewProtocol +public extension Container { + override func updateView(_ size: CGFloat) { + super.updateView(size) + (view as? MVMCoreViewProtocol)?.updateView(size) + containerHelper.updateViewMargins(self, model: containerModel, size: size) + } + + /// Will be called only once. + override func setupView() { + super.setupView() + backgroundColor = .clear + } + + func addAndContain(_ view: UIView) { + view.translatesAutoresizingMaskIntoConstraints = false + addSubview(view) + containerHelper.constrainView(view) + self.view = view + } + + convenience init(andContain view: UIView) { + self.init() + addAndContain(view) + } +} + +// MARK: - MVMCoreUIMoleculeViewProtocol +public extension Container { + override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) + guard let view = view else { return } + containerHelper.set(with: json, for: view) + } + + override func reset() { + super.reset() + (view as? MVMCoreUIMoleculeViewProtocol)?.reset?() + } + + override func setAsMolecule() { + (view as? MVMCoreUIMoleculeViewProtocol)?.setAsMolecule?() + } +} diff --git a/MVMCoreUI/Containers/Container.swift b/MVMCoreUI/Containers/Views/Container/ContainerHelper.swift similarity index 76% rename from MVMCoreUI/Containers/Container.swift rename to MVMCoreUI/Containers/Views/Container/ContainerHelper.swift index 42a53848..77226341 100644 --- a/MVMCoreUI/Containers/Container.swift +++ b/MVMCoreUI/Containers/Views/Container/ContainerHelper.swift @@ -1,12 +1,13 @@ // -// Container.swift +// ContainerHelper.swift // MVMCoreUI // -// Created by Scott Pfeil on 12/11/19. -// Copyright © 2019 Verizon Wireless. All rights reserved. +// Created by Scott Pfeil on 1/21/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. // +// A Helper that consolidates some common container logic -import UIKit +import Foundation public class ContainerHelper: NSObject { var leftConstraint: NSLayoutConstraint? @@ -195,76 +196,3 @@ public class ContainerHelper: NSObject { } } } - -open class Container: View, ContainerProtocol { - public var view: UIView? - let containerHelper = ContainerHelper() - var containerModel: ContainerModelProtocol? { - get { return model as? ContainerModelProtocol } - } - - // MARK:- ModelMoleculeViewProtocol - override open func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { - super.setWithModel(model, delegateObject, additionalData) - guard let containerModel = model as? ContainerModelProtocol else { return } - containerHelper.set(with: containerModel, for: view as? MVMCoreUIViewConstrainingProtocol) - } - - // MARK:- ContainerProtocol - public func alignHorizontal(_ alignment: UIStackView.Alignment) { - containerHelper.alignHorizontal(alignment) - } - - public func alignVertical(_ alignment: UIStackView.Alignment) { - containerHelper.alignVertical(alignment) - } - - public func constrainView(_ view: UIView) { - containerHelper.constrainView(view) - } -} - -// MARK: - MVMCoreViewProtocol -public extension Container { - override func updateView(_ size: CGFloat) { - super.updateView(size) - (view as? MVMCoreViewProtocol)?.updateView(size) - containerHelper.updateViewMargins(self, model: containerModel, size: size) - } - - /// Will be called only once. - override func setupView() { - super.setupView() - backgroundColor = .clear - } - - func addAndContain(_ view: UIView) { - view.translatesAutoresizingMaskIntoConstraints = false - addSubview(view) - containerHelper.constrainView(view) - self.view = view - } - - convenience init(andContain view: UIView) { - self.init() - addAndContain(view) - } -} - -// MARK: - MVMCoreUIMoleculeViewProtocol -public extension Container { - override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { - super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) - guard let view = view else { return } - containerHelper.set(with: json, for: view) - } - - override func reset() { - super.reset() - (view as? MVMCoreUIMoleculeViewProtocol)?.reset?() - } - - override func setAsMolecule() { - (view as? MVMCoreUIMoleculeViewProtocol)?.setAsMolecule?() - } -} diff --git a/MVMCoreUI/Models/Container/ContainerModel.swift b/MVMCoreUI/Containers/Views/Container/ContainerModel.swift similarity index 98% rename from MVMCoreUI/Models/Container/ContainerModel.swift rename to MVMCoreUI/Containers/Views/Container/ContainerModel.swift index 9930ab5c..1b721183 100644 --- a/MVMCoreUI/Models/Container/ContainerModel.swift +++ b/MVMCoreUI/Containers/Views/Container/ContainerModel.swift @@ -17,7 +17,7 @@ public class ContainerModel: ContainerModelProtocol, Codable { public var topMarginPadding: CGFloat? public var bottomMarginPadding: CGFloat? - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case verticalAlignment case horizontalAlignment case useHorizontalMargins diff --git a/MVMCoreUI/Containers/ContainerProtocol.swift b/MVMCoreUI/Containers/Views/Container/ContainerProtocol.swift similarity index 100% rename from MVMCoreUI/Containers/ContainerProtocol.swift rename to MVMCoreUI/Containers/Views/Container/ContainerProtocol.swift diff --git a/MVMCoreUI/Containers/Views/EntryFieldContainer.swift b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift new file mode 100644 index 00000000..96a51a8f --- /dev/null +++ b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift @@ -0,0 +1,285 @@ +// +// EntryFieldContainer.swift +// MVMCoreUI +// +// Created by Kevin Christiano on 11/12/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +import UIKit + + +@objcMembers open class EntryFieldContainer: View { + //-------------------------------------------------- + // MARK: - Drawing Properties + //-------------------------------------------------- + + /// The bottom border line. Height is dynamic based on scenario. + public var bottomBar: CAShapeLayer? = { + let layer = CAShapeLayer() + layer.backgroundColor = UIColor.black.cgColor + layer.drawsAsynchronously = true + layer.anchorPoint = CGPoint(x: 0.5, y: 1.0); + return layer + }() + + /// Total control over the drawn top, bottom, left and right borders. + public var disableAllBorders = false { + didSet { + bottomBar?.isHidden = disableAllBorders + } + } + + private(set) var fieldState: FieldState = .original { + didSet (oldState) { + // Will not update if new state is the same as old. + if fieldState != oldState { + DispatchQueue.main.async { [weak self] in + guard let self = self else { return } + + self.fieldState.setStateUI(for: self) + } + } + } + } + + /// Determines if the top, left, and right borders should be drawn. + private var hideBorders = false + + public var borderStrokeColor: UIColor = .mfSilver() + private var borderPath: UIBezierPath = UIBezierPath() + + //-------------------------------------------------- + // MARK: - Property Observers + //-------------------------------------------------- + + private var _isEnabled: Bool = true + private var _showError: Bool = false + private var _isLocked: Bool = false + private var _isSelected: Bool = false + + public var isEnabled: Bool { + get { return _isEnabled } + set (enabled) { + + _isEnabled = enabled + _isLocked = false + _isSelected = false + _showError = false + + fieldState = enabled ? .original : .disabled + } + } + + public var showError: Bool { + get { return _showError } + set (error) { + + _showError = error + _isEnabled = true + _isLocked = false + _isSelected = false + + fieldState = error ? .error : .original + } + } + + public var isLocked: Bool { + get { return _isLocked } + set (locked) { + + _isLocked = locked + _isEnabled = true + _isSelected = false + _showError = false + + fieldState = locked ? .locked : .original + } + } + + public var isSelected: Bool { + get { return _isSelected } + set (selected) { + + _isSelected = selected + _isLocked = false + _isEnabled = true + + if _showError { + fieldState = selected ? .selectedError : .error + } else { + fieldState = selected ? .selected : .original + } + } + } + + //-------------------------------------------------- + // MARK: - Delegate + //-------------------------------------------------- + + /// Holds reference to delegateObject to inform molecular tableView of an update. + weak var delegateObject: MVMCoreUIDelegateObject? + + //-------------------------------------------------- + // MARK: - Lifecycle + //-------------------------------------------------- + + open override func layoutSubviews() { + super.layoutSubviews() + + refreshUI(bottomBarSize: showError ? 4 : 1) + } + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + + refreshUI() + } + + /// This handles the top, left, and right border lines. + open override func draw(_ rect: CGRect) { + super.draw(rect) + + borderPath.removeAllPoints() + + if !disableAllBorders && !hideBorders { + // Brings the other half of the line inside the view to prevent cropping. + let origin = bounds.origin + let size = frame.size + let insetLean: CGFloat = 0.5 + borderPath.lineWidth = 1 + + borderPath.move(to: CGPoint(x: origin.x + insetLean, y: origin.y + size.height)) + borderPath.addLine(to: CGPoint(x: origin.x + insetLean, y: origin.y + insetLean)) + borderPath.addLine(to: CGPoint(x: origin.x + size.width - insetLean, y: origin.y + insetLean)) + borderPath.addLine(to: CGPoint(x: origin.x + size.width - insetLean, y: origin.y + size.height)) + + borderStrokeColor.setStroke() + borderPath.stroke() + } + } + + override open func setupView() { + super.setupView() + + isAccessibilityElement = false + isOpaque = false + + if let bottomBar = bottomBar { + layer.addSublayer(bottomBar) + } + } + + //-------------------------------------------------- + // MARK: - Draw States + //-------------------------------------------------- + + public enum FieldState { + case original + case error + case selectedError + case selected + case locked + case disabled + + public func setStateUI(for formField: EntryFieldContainer) { + + switch self { + case .original: + formField.originalUI() + + case .error: + formField.errorUI() + + case .selectedError: + formField.selectedErrorUI() + + case .selected: + formField.selectedUI() + + case .locked: + formField.lockedUI() + + case .disabled: + formField.disabledUI() + } + } + } + + open func originalUI() { + + isUserInteractionEnabled = true + hideBorders = false + borderStrokeColor = .mfSilver() + bottomBar?.backgroundColor = UIColor.black.cgColor + refreshUI(bottomBarSize: 1) + } + + open func errorUI() { + + isUserInteractionEnabled = true + hideBorders = false + borderStrokeColor = .mfPumpkin() + bottomBar?.backgroundColor = UIColor.mfPumpkin().cgColor + refreshUI(bottomBarSize: 4) + } + + open func selectedErrorUI() { + + isUserInteractionEnabled = true + hideBorders = false + borderStrokeColor = .black + bottomBar?.backgroundColor = UIColor.mfPumpkin().cgColor + refreshUI(bottomBarSize: 4) + } + + open func selectedUI() { + + isUserInteractionEnabled = true + hideBorders = false + borderStrokeColor = .black + bottomBar?.backgroundColor = UIColor.black.cgColor + refreshUI(bottomBarSize: 1) + } + + open func lockedUI() { + + isUserInteractionEnabled = false + hideBorders = true + borderStrokeColor = .clear + bottomBar?.backgroundColor = UIColor.clear.cgColor + refreshUI(bottomBarSize: 1) + } + + open func disabledUI() { + + isUserInteractionEnabled = false + hideBorders = false + borderStrokeColor = .mfSilver() + bottomBar?.backgroundColor = UIColor.mfSilver().cgColor + refreshUI(bottomBarSize: 1) + } + + open func refreshUI(bottomBarSize: CGFloat? = nil) { + + if !disableAllBorders { + let size: CGFloat = bottomBarSize ?? (showError ? 4 : 1) + bottomBar?.frame = CGRect(x: 0, y: bounds.height - size, width: bounds.width, height: size) + + delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) + setNeedsDisplay() + layoutIfNeeded() + } + } +} + +// MARK:- MVMCoreUIMoleculeViewProtocol +extension EntryFieldContainer { + + override open func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { + super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData) + self.delegateObject = delegateObject + + guard let dictionary = json, !dictionary.isEmpty else { return } + } +} diff --git a/MVMCoreUI/Molecules/MoleculeContainer.swift b/MVMCoreUI/Containers/Views/MoleculeContainer.swift similarity index 100% rename from MVMCoreUI/Molecules/MoleculeContainer.swift rename to MVMCoreUI/Containers/Views/MoleculeContainer.swift diff --git a/MVMCoreUI/Models/Container/MoleculeContainerModel.swift b/MVMCoreUI/Containers/Views/MoleculeContainerModel.swift similarity index 77% rename from MVMCoreUI/Models/Container/MoleculeContainerModel.swift rename to MVMCoreUI/Containers/Views/MoleculeContainerModel.swift index c29fcd2a..284b91ee 100644 --- a/MVMCoreUI/Models/Container/MoleculeContainerModel.swift +++ b/MVMCoreUI/Containers/Views/MoleculeContainerModel.swift @@ -11,7 +11,7 @@ import Foundation public class MoleculeContainerModel: ContainerModel { public var molecule: MoleculeProtocol - enum MoleculeContainerCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case molecule } @@ -21,14 +21,14 @@ public class MoleculeContainerModel: ContainerModel { } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: MoleculeContainerCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) molecule = try typeContainer.decodeMolecule(codingKey: .molecule) try super.init(from: decoder) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: MoleculeContainerCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeModel(molecule, forKey: .molecule) } } diff --git a/MVMCoreUI/Models/Primitive Models/Color.swift b/MVMCoreUI/CustomPrimitives/Color.swift similarity index 100% rename from MVMCoreUI/Models/Primitive Models/Color.swift rename to MVMCoreUI/CustomPrimitives/Color.swift diff --git a/MVMCoreUI/Atoms/Buttons/ButtonDelegateProtocol.h b/MVMCoreUI/Legacy/Views/ButtonDelegateProtocol.h similarity index 100% rename from MVMCoreUI/Atoms/Buttons/ButtonDelegateProtocol.h rename to MVMCoreUI/Legacy/Views/ButtonDelegateProtocol.h diff --git a/MVMCoreUI/Atoms/Buttons/MFButtonProtocol.h b/MVMCoreUI/Legacy/Views/MFButtonProtocol.h similarity index 100% rename from MVMCoreUI/Atoms/Buttons/MFButtonProtocol.h rename to MVMCoreUI/Legacy/Views/MFButtonProtocol.h diff --git a/MVMCoreUI/Atoms/Buttons/MFCustomButton.h b/MVMCoreUI/Legacy/Views/MFCustomButton.h similarity index 100% rename from MVMCoreUI/Atoms/Buttons/MFCustomButton.h rename to MVMCoreUI/Legacy/Views/MFCustomButton.h diff --git a/MVMCoreUI/Atoms/Buttons/MFCustomButton.m b/MVMCoreUI/Legacy/Views/MFCustomButton.m similarity index 100% rename from MVMCoreUI/Atoms/Buttons/MFCustomButton.m rename to MVMCoreUI/Legacy/Views/MFCustomButton.m diff --git a/MVMCoreUI/Atoms/TextFields/MFDigitTextBox.h b/MVMCoreUI/Legacy/Views/MFDigitTextBox.h similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFDigitTextBox.h rename to MVMCoreUI/Legacy/Views/MFDigitTextBox.h diff --git a/MVMCoreUI/Atoms/TextFields/MFDigitTextBox.m b/MVMCoreUI/Legacy/Views/MFDigitTextBox.m similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFDigitTextBox.m rename to MVMCoreUI/Legacy/Views/MFDigitTextBox.m diff --git a/MVMCoreUI/Atoms/TextFields/MFDigitTextField.h b/MVMCoreUI/Legacy/Views/MFDigitTextField.h similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFDigitTextField.h rename to MVMCoreUI/Legacy/Views/MFDigitTextField.h diff --git a/MVMCoreUI/Atoms/TextFields/MFDigitTextField.m b/MVMCoreUI/Legacy/Views/MFDigitTextField.m similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFDigitTextField.m rename to MVMCoreUI/Legacy/Views/MFDigitTextField.m diff --git a/MVMCoreUI/Atoms/TextFields/MFDigitTextField.xib b/MVMCoreUI/Legacy/Views/MFDigitTextField.xib similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFDigitTextField.xib rename to MVMCoreUI/Legacy/Views/MFDigitTextField.xib diff --git a/MVMCoreUI/Atoms/Views/MFLoadingSpinner.h b/MVMCoreUI/Legacy/Views/MFLoadingSpinner.h similarity index 100% rename from MVMCoreUI/Atoms/Views/MFLoadingSpinner.h rename to MVMCoreUI/Legacy/Views/MFLoadingSpinner.h diff --git a/MVMCoreUI/Atoms/Views/MFLoadingSpinner.m b/MVMCoreUI/Legacy/Views/MFLoadingSpinner.m similarity index 100% rename from MVMCoreUI/Atoms/Views/MFLoadingSpinner.m rename to MVMCoreUI/Legacy/Views/MFLoadingSpinner.m diff --git a/MVMCoreUI/Atoms/TextFields/MFMdnTextField.h b/MVMCoreUI/Legacy/Views/MFMdnTextField.h similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFMdnTextField.h rename to MVMCoreUI/Legacy/Views/MFMdnTextField.h diff --git a/MVMCoreUI/Atoms/TextFields/MFMdnTextField.m b/MVMCoreUI/Legacy/Views/MFMdnTextField.m similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFMdnTextField.m rename to MVMCoreUI/Legacy/Views/MFMdnTextField.m diff --git a/MVMCoreUI/Atoms/Buttons/MFTextButton.h b/MVMCoreUI/Legacy/Views/MFTextButton.h similarity index 100% rename from MVMCoreUI/Atoms/Buttons/MFTextButton.h rename to MVMCoreUI/Legacy/Views/MFTextButton.h diff --git a/MVMCoreUI/Atoms/Buttons/MFTextButton.m b/MVMCoreUI/Legacy/Views/MFTextButton.m similarity index 100% rename from MVMCoreUI/Atoms/Buttons/MFTextButton.m rename to MVMCoreUI/Legacy/Views/MFTextButton.m diff --git a/MVMCoreUI/Atoms/TextFields/MFTextField.h b/MVMCoreUI/Legacy/Views/MFTextField.h similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFTextField.h rename to MVMCoreUI/Legacy/Views/MFTextField.h diff --git a/MVMCoreUI/Atoms/TextFields/MFTextField.m b/MVMCoreUI/Legacy/Views/MFTextField.m similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFTextField.m rename to MVMCoreUI/Legacy/Views/MFTextField.m diff --git a/MVMCoreUI/Atoms/TextFields/MFTextField.xib b/MVMCoreUI/Legacy/Views/MFTextField.xib similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFTextField.xib rename to MVMCoreUI/Legacy/Views/MFTextField.xib diff --git a/MVMCoreUI/Atoms/TextFields/MFTextFieldSubclassExtension.h b/MVMCoreUI/Legacy/Views/MFTextFieldSubclassExtension.h similarity index 100% rename from MVMCoreUI/Atoms/TextFields/MFTextFieldSubclassExtension.h rename to MVMCoreUI/Legacy/Views/MFTextFieldSubclassExtension.h diff --git a/MVMCoreUI/Atoms/Views/MFTextView.h b/MVMCoreUI/Legacy/Views/MFTextView.h similarity index 100% rename from MVMCoreUI/Atoms/Views/MFTextView.h rename to MVMCoreUI/Legacy/Views/MFTextView.h diff --git a/MVMCoreUI/Atoms/Views/MFTextView.m b/MVMCoreUI/Legacy/Views/MFTextView.m similarity index 100% rename from MVMCoreUI/Atoms/Views/MFTextView.m rename to MVMCoreUI/Legacy/Views/MFTextView.m diff --git a/MVMCoreUI/Atoms/Views/MFTextView.xib b/MVMCoreUI/Legacy/Views/MFTextView.xib similarity index 100% rename from MVMCoreUI/Atoms/Views/MFTextView.xib rename to MVMCoreUI/Legacy/Views/MFTextView.xib diff --git a/MVMCoreUI/Molecules/MVMCoreUIMoleculeViewProtocol.h b/MVMCoreUI/Legacy/Views/MVMCoreUIMoleculeViewProtocol.h similarity index 100% rename from MVMCoreUI/Molecules/MVMCoreUIMoleculeViewProtocol.h rename to MVMCoreUI/Legacy/Views/MVMCoreUIMoleculeViewProtocol.h diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUIPageControl.h b/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.h similarity index 100% rename from MVMCoreUI/Atoms/Views/MVMCoreUIPageControl.h rename to MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.h diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUIPageControl.m b/MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.m similarity index 100% rename from MVMCoreUI/Atoms/Views/MVMCoreUIPageControl.m rename to MVMCoreUI/Legacy/Views/MVMCoreUIPageControl.m diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUIPagingProtocol.h b/MVMCoreUI/Legacy/Views/MVMCoreUIPagingProtocol.h similarity index 100% rename from MVMCoreUI/Atoms/Views/MVMCoreUIPagingProtocol.h rename to MVMCoreUI/Legacy/Views/MVMCoreUIPagingProtocol.h diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUISwitch.h b/MVMCoreUI/Legacy/Views/MVMCoreUISwitch.h similarity index 100% rename from MVMCoreUI/Atoms/Views/MVMCoreUISwitch.h rename to MVMCoreUI/Legacy/Views/MVMCoreUISwitch.h diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUISwitch.m b/MVMCoreUI/Legacy/Views/MVMCoreUISwitch.m similarity index 100% rename from MVMCoreUI/Atoms/Views/MVMCoreUISwitch.m rename to MVMCoreUI/Legacy/Views/MVMCoreUISwitch.m diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUITextFieldView.h b/MVMCoreUI/Legacy/Views/MVMCoreUITextFieldView.h similarity index 100% rename from MVMCoreUI/Atoms/Views/MVMCoreUITextFieldView.h rename to MVMCoreUI/Legacy/Views/MVMCoreUITextFieldView.h diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUITextFieldView.m b/MVMCoreUI/Legacy/Views/MVMCoreUITextFieldView.m similarity index 100% rename from MVMCoreUI/Atoms/Views/MVMCoreUITextFieldView.m rename to MVMCoreUI/Legacy/Views/MVMCoreUITextFieldView.m diff --git a/MVMCoreUI/Atoms/Buttons/PrimaryButton.h b/MVMCoreUI/Legacy/Views/PrimaryButton.h similarity index 100% rename from MVMCoreUI/Atoms/Buttons/PrimaryButton.h rename to MVMCoreUI/Legacy/Views/PrimaryButton.h diff --git a/MVMCoreUI/Atoms/Buttons/PrimaryButton.m b/MVMCoreUI/Legacy/Views/PrimaryButton.m similarity index 100% rename from MVMCoreUI/Atoms/Buttons/PrimaryButton.m rename to MVMCoreUI/Legacy/Views/PrimaryButton.m diff --git a/MVMCoreUI/Atoms/Views/TextButtonView.h b/MVMCoreUI/Legacy/Views/TextButtonView.h similarity index 100% rename from MVMCoreUI/Atoms/Views/TextButtonView.h rename to MVMCoreUI/Legacy/Views/TextButtonView.h diff --git a/MVMCoreUI/Atoms/Views/TextButtonView.m b/MVMCoreUI/Legacy/Views/TextButtonView.m similarity index 100% rename from MVMCoreUI/Atoms/Views/TextButtonView.m rename to MVMCoreUI/Legacy/Views/TextButtonView.m diff --git a/MVMCoreUI/Molecules/TopLabelsView.h b/MVMCoreUI/Legacy/Views/TopLabelsView.h similarity index 100% rename from MVMCoreUI/Molecules/TopLabelsView.h rename to MVMCoreUI/Legacy/Views/TopLabelsView.h diff --git a/MVMCoreUI/Molecules/TopLabelsView.m b/MVMCoreUI/Legacy/Views/TopLabelsView.m similarity index 100% rename from MVMCoreUI/Molecules/TopLabelsView.m rename to MVMCoreUI/Legacy/Views/TopLabelsView.m diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.h b/MVMCoreUI/Legacy/Views/ViewConstrainingView.h similarity index 100% rename from MVMCoreUI/Atoms/Views/ViewConstrainingView.h rename to MVMCoreUI/Legacy/Views/ViewConstrainingView.h diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m b/MVMCoreUI/Legacy/Views/ViewConstrainingView.m similarity index 100% rename from MVMCoreUI/Atoms/Views/ViewConstrainingView.m rename to MVMCoreUI/Legacy/Views/ViewConstrainingView.m diff --git a/MVMCoreUI/Models/Container/ContainerModelProtocol.swift b/MVMCoreUI/Models/ModelProtocols/ContainerModelProtocol.swift similarity index 100% rename from MVMCoreUI/Models/Container/ContainerModelProtocol.swift rename to MVMCoreUI/Models/ModelProtocols/ContainerModelProtocol.swift diff --git a/MVMCoreUI/Models/Molecules/FooterModel.swift b/MVMCoreUI/Molecules/FooterModel.swift similarity index 87% rename from MVMCoreUI/Models/Molecules/FooterModel.swift rename to MVMCoreUI/Molecules/FooterModel.swift index e31ec1fc..a534ed87 100644 --- a/MVMCoreUI/Models/Molecules/FooterModel.swift +++ b/MVMCoreUI/Molecules/FooterModel.swift @@ -13,7 +13,7 @@ import Foundation public static var identifier: String = "footer" public var backgroundColor: Color? - enum FooterCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor } @@ -39,7 +39,7 @@ import Foundation } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: FooterCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) try super.init(from: decoder) setDefaults() @@ -47,7 +47,7 @@ import Foundation public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: FooterCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) } } diff --git a/MVMCoreUI/Molecules/StandardFooterView.swift b/MVMCoreUI/Molecules/FooterView.swift similarity index 88% rename from MVMCoreUI/Molecules/StandardFooterView.swift rename to MVMCoreUI/Molecules/FooterView.swift index e433ec88..b9113d1d 100644 --- a/MVMCoreUI/Molecules/StandardFooterView.swift +++ b/MVMCoreUI/Molecules/FooterView.swift @@ -1,5 +1,5 @@ // -// StandardFooterView.swift +// FooterView.swift // MVMCoreUI // // Created by Scott Pfeil on 3/11/19. @@ -8,7 +8,7 @@ import UIKit -open class StandardFooterView: MoleculeContainer { +open class FooterView: MoleculeContainer { public class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { if let moleculeJSON = json?.optionalDictionaryForKey(KeyMolecule), let height = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: moleculeJSON)?.estimatedHeight?(forRow: moleculeJSON, delegateObject: delegateObject) { return height + PaddingDefaultVerticalSpacing + PaddingDefaultVerticalSpacing diff --git a/MVMCoreUI/Models/Molecules/HeaderModel.swift b/MVMCoreUI/Molecules/HeaderModel.swift similarity index 86% rename from MVMCoreUI/Models/Molecules/HeaderModel.swift rename to MVMCoreUI/Molecules/HeaderModel.swift index 4499d313..ab7d5427 100644 --- a/MVMCoreUI/Models/Molecules/HeaderModel.swift +++ b/MVMCoreUI/Molecules/HeaderModel.swift @@ -13,7 +13,7 @@ import Foundation public var backgroundColor: Color? public var line: LineModel? - enum HeaderCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case line case backgroundColor @@ -43,14 +43,14 @@ import Foundation required public init(from decoder: Decoder) throws { try super.init(from: decoder) - let typeContainer = try decoder.container(keyedBy: HeaderCodingKeys.self) - line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) setDefaults() + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) ?? LineModel(type: .heavy) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: HeaderCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) try container.encode(line, forKey: .line) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) diff --git a/MVMCoreUI/Molecules/StandardHeaderView.swift b/MVMCoreUI/Molecules/HeaderView.swift similarity index 96% rename from MVMCoreUI/Molecules/StandardHeaderView.swift rename to MVMCoreUI/Molecules/HeaderView.swift index ad231597..f04661e2 100644 --- a/MVMCoreUI/Molecules/StandardHeaderView.swift +++ b/MVMCoreUI/Molecules/HeaderView.swift @@ -1,5 +1,5 @@ // -// StandardHeaderView.swift +// HeaderView.swift // MVMCoreUI // // Created by Scott Pfeil on 2/12/19. @@ -8,7 +8,7 @@ import UIKit -public class StandardHeaderView: MoleculeContainer { +public class HeaderView: MoleculeContainer { var line: Line? var headerModel: HeaderModel? { diff --git a/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift b/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift index 0e358871..2cf86858 100644 --- a/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift +++ b/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift @@ -17,7 +17,7 @@ public class TabsModel: MoleculeProtocol { // Must be capped to 0...(tabs.count - 1) public var selectedIndex: Int = 0 - enum TabsCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case tabs case backgroundColor case selectedColor @@ -29,7 +29,7 @@ public class TabsModel: MoleculeProtocol { } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: TabsCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) tabs = try typeContainer.decode([LabelModel].self, forKey: .tabs) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) if let color = try typeContainer.decodeIfPresent(Color.self, forKey: .selectedColor) { @@ -41,7 +41,7 @@ public class TabsModel: MoleculeProtocol { } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: TabsCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(tabs, forKey: .tabs) try container.encode(backgroundColor, forKey: .backgroundColor) try container.encode(selectedColor, forKey: .selectedColor) diff --git a/MVMCoreUI/Molecules/Items/AccordionListItemModel.swift b/MVMCoreUI/Molecules/Items/AccordionListItemModel.swift index d5519288..5d88b913 100644 --- a/MVMCoreUI/Molecules/Items/AccordionListItemModel.swift +++ b/MVMCoreUI/Molecules/Items/AccordionListItemModel.swift @@ -16,7 +16,7 @@ class AccordionListItemModel: MoleculeContainerModel, ListItemModelProtocol { public var hideArrow: Bool? = true public var line: LineModel? - enum AccordionListItemCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case molecules case backgroundColor case hideLineWhenExpanded @@ -25,7 +25,7 @@ class AccordionListItemModel: MoleculeContainerModel, ListItemModelProtocol { } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: AccordionListItemCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) molecules = try typeContainer.decodeMolecules(codingKey: .molecules) as! [ListItemModelProtocol] backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) @@ -37,7 +37,7 @@ class AccordionListItemModel: MoleculeContainerModel, ListItemModelProtocol { public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: AccordionListItemCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeModels(molecules, forKey: .molecules) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeIfPresent(hideLineWhenExpanded, forKey: .hideLineWhenExpanded) diff --git a/MVMCoreUI/Molecules/Items/DropDownListItemModel.swift b/MVMCoreUI/Molecules/Items/DropDownListItemModel.swift index 64e8c69b..86b0ac82 100644 --- a/MVMCoreUI/Molecules/Items/DropDownListItemModel.swift +++ b/MVMCoreUI/Molecules/Items/DropDownListItemModel.swift @@ -22,7 +22,7 @@ import Foundation super.init(with: molecule) } - enum DropDownCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case molecules case dropDown case line @@ -30,7 +30,7 @@ import Foundation } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: DropDownCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) molecules = try typeContainer.decodeMolecules2D(codingKey: .molecules) as! [[ListItemModelProtocol]] dropDown = try typeContainer.decode(DropDownModel.self, forKey: .dropDown) if let lineModel = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) { @@ -42,7 +42,7 @@ import Foundation public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: DropDownCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeModels2D(molecules, forKey: .molecules) try container.encode(dropDown, forKey: .dropDown) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) diff --git a/MVMCoreUI/Molecules/Items/ListItemModel.swift b/MVMCoreUI/Molecules/Items/ListItemModel.swift index 5e54a2e9..c564c214 100644 --- a/MVMCoreUI/Molecules/Items/ListItemModel.swift +++ b/MVMCoreUI/Molecules/Items/ListItemModel.swift @@ -17,7 +17,7 @@ import MVMCore public var line: LineModel? public var style: String? = "standard" - enum ListItemCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor case action case hideArrow @@ -47,7 +47,7 @@ import MVMCore } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: ListItemCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) action = try typeContainer.decodeModelIfPresent(codingKey: .action, typeCodingKey: ActionCodingKey.actionType) hideArrow = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideArrow) @@ -61,7 +61,7 @@ import MVMCore public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: ListItemCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeModelIfPresent(action, forKey: .action) try container.encodeIfPresent(hideArrow, forKey: .hideArrow) diff --git a/MVMCoreUI/Molecules/Items/MoleculeStackItemModel.swift b/MVMCoreUI/Molecules/Items/MoleculeStackItemModel.swift index e2ee337d..0661e907 100644 --- a/MVMCoreUI/Molecules/Items/MoleculeStackItemModel.swift +++ b/MVMCoreUI/Molecules/Items/MoleculeStackItemModel.swift @@ -15,7 +15,7 @@ import Foundation public var percent: Int? public var gone: Bool = false - enum MoleculeStackItemCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case spacing case percent case gone @@ -26,7 +26,7 @@ import Foundation } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: MoleculeStackItemCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) spacing = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .spacing) percent = try typeContainer.decodeIfPresent(Int.self, forKey: .percent) if let gone = try typeContainer.decodeIfPresent(Bool.self, forKey: .gone) { @@ -37,7 +37,7 @@ import Foundation public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: MoleculeStackItemCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(spacing, forKey: .spacing) try container.encodeIfPresent(percent, forKey: .percent) try container.encode(gone, forKey: .gone) diff --git a/MVMCoreUI/Molecules/Items/TabsListItemModel.swift b/MVMCoreUI/Molecules/Items/TabsListItemModel.swift index d27b9097..13dd09e7 100644 --- a/MVMCoreUI/Molecules/Items/TabsListItemModel.swift +++ b/MVMCoreUI/Molecules/Items/TabsListItemModel.swift @@ -17,7 +17,7 @@ public class TabsListItemModel: ContainerModel, ListItemModelProtocol { public var hideArrow: Bool? = true public var line: LineModel? = LineModel(type: .standard) - enum TabsListItemCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case tabs case molecules case backgroundColor @@ -33,7 +33,7 @@ public class TabsListItemModel: ContainerModel, ListItemModelProtocol { } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: TabsListItemCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) tabs = try typeContainer.decode(TabsModel.self, forKey: .tabs) molecules = try typeContainer.decodeMolecules2D(codingKey: .molecules) as! [[ListItemModelProtocol]] backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) @@ -45,7 +45,7 @@ public class TabsListItemModel: ContainerModel, ListItemModelProtocol { public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: TabsListItemCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(tabs, forKey: .tabs) try container.encodeModels2D(molecules, forKey: .molecules) try container.encode(backgroundColor, forKey: .backgroundColor) diff --git a/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift b/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift index c61bd408..472be993 100644 --- a/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift +++ b/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift @@ -21,7 +21,7 @@ public class CornerLabelsModel: MoleculeProtocol { self.molecule = molecule } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case backgroundColor case topLeftLabel case topRightLabel diff --git a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift index 728ae3a8..857ef7bc 100644 --- a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift +++ b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift @@ -13,7 +13,7 @@ import Foundation return "numberedList" } - private enum NumberedListCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case backgroundColor case list @@ -21,7 +21,7 @@ import Foundation // Numbered list model comes in the from of list = [MoleculeProtocol] public required init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: NumberedListCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) let list = try typeContainer.decodeMolecules(codingKey: .list) var models: [MoleculeStackItemModel] = [] @@ -33,7 +33,7 @@ import Foundation } public override func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: NumberedListCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) var models: [MoleculeProtocol] = [] diff --git a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift index f2c73cab..23e32218 100644 --- a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift +++ b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift @@ -19,7 +19,7 @@ public class StringAndMoleculeModel: MoleculeProtocol { self.molecule = molecule } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case backgroundColor case string diff --git a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift index a905401c..aeb8b34e 100644 --- a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift +++ b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift @@ -14,7 +14,7 @@ import Foundation } public var bulletChar = "•" - private enum NumberedListCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case backgroundColor case list @@ -23,7 +23,7 @@ import Foundation // Numbered list model comes in the from of list = [MoleculeProtocol] public required init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: NumberedListCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) if let bulletChar = try typeContainer.decodeIfPresent(String.self, forKey: .bulletChar) { self.bulletChar = bulletChar } @@ -38,7 +38,7 @@ import Foundation } public override func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: NumberedListCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(bulletChar, forKey: .bulletChar) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) diff --git a/MVMCoreUI/Organisms/MoleculeStackModel.swift b/MVMCoreUI/Organisms/MoleculeStackModel.swift index 5f33725e..c8922204 100644 --- a/MVMCoreUI/Organisms/MoleculeStackModel.swift +++ b/MVMCoreUI/Organisms/MoleculeStackModel.swift @@ -24,7 +24,7 @@ import Foundation super.init() } - enum StackCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case molecules case axis @@ -32,7 +32,7 @@ import Foundation } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: StackCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) molecules = try typeContainer.decode([MoleculeStackItemModel].self, forKey: .molecules) if let axisString = try typeContainer.decodeIfPresent(String.self, forKey: .axis), let optionalAxis = NSLayoutConstraint.Axis(rawValue: axisString) { axis = optionalAxis @@ -45,7 +45,7 @@ import Foundation public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) - var container = encoder.container(keyedBy: StackCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) try container.encodeIfPresent(molecules, forKey: .molecules) try container.encodeIfPresent(axis.rawValueString, forKey: .axis) diff --git a/MVMCoreUI/Organisms/StackModel.swift b/MVMCoreUI/Organisms/StackModel.swift index deea2457..8368ce8c 100644 --- a/MVMCoreUI/Organisms/StackModel.swift +++ b/MVMCoreUI/Organisms/StackModel.swift @@ -20,7 +20,7 @@ import Foundation self.molecules = molecules } - enum StackCodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case backgroundColor case molecules @@ -29,7 +29,7 @@ import Foundation } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: StackCodingKeys.self) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) molecules = try typeContainer.decode([StackItemModel].self, forKey: .molecules) if let axisString = try typeContainer.decodeIfPresent(String.self, forKey: .axis), let optionalAxis = NSLayoutConstraint.Axis(rawValue: axisString) { @@ -41,7 +41,7 @@ import Foundation } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: StackCodingKeys.self) + var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(molecules, forKey: .molecules) try container.encodeIfPresent(axis.rawValueString, forKey: .axis) try container.encodeIfPresent(spacing, forKey: .spacing) diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m b/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m index 1eda2454..1e589134 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUIMoleculeMappingObject.m @@ -30,9 +30,9 @@ @"line": Line.class, @"button": PrimaryButton.class, @"link": MFTextButton.class, - @"header": StandardHeaderView.class, + @"header": HeaderView.class, @"twoButtonView": TwoButtonView.class, - @"footer": StandardFooterView.class, + @"footer": FooterView.class, @"caretView": CaretView.class, @"caretLink": CaretButton.class, @"textField": MFTextField.class, diff --git a/MVMCoreUI/Models/Template/ListPageTemplateModel.swift b/MVMCoreUI/Templates/ListPageTemplateModel.swift similarity index 98% rename from MVMCoreUI/Models/Template/ListPageTemplateModel.swift rename to MVMCoreUI/Templates/ListPageTemplateModel.swift index c3b2a120..4a301660 100644 --- a/MVMCoreUI/Models/Template/ListPageTemplateModel.swift +++ b/MVMCoreUI/Templates/ListPageTemplateModel.swift @@ -27,7 +27,7 @@ import Foundation self.molecules = molecules } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case moleculeName case pageType case screenHeading diff --git a/MVMCoreUI/Models/Template/StackCenteredPageTemplateModel.swift b/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift similarity index 99% rename from MVMCoreUI/Models/Template/StackCenteredPageTemplateModel.swift rename to MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift index 804103c4..86c09b6d 100644 --- a/MVMCoreUI/Models/Template/StackCenteredPageTemplateModel.swift +++ b/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift @@ -11,11 +11,7 @@ import Foundation @objcMembers public class StackCenteredPageTemplateModel: TemplateModelProtocol { public static var identifier: String = "stackCenterTemplate" - public var pageType: String - public var screenHeading: String? - public var isAtomicTabs: Bool? - } diff --git a/MVMCoreUI/Models/Template/StackPageTemplateModel.swift b/MVMCoreUI/Templates/StackPageTemplateModel.swift similarity index 97% rename from MVMCoreUI/Models/Template/StackPageTemplateModel.swift rename to MVMCoreUI/Templates/StackPageTemplateModel.swift index 0e5e4488..db9d632d 100644 --- a/MVMCoreUI/Models/Template/StackPageTemplateModel.swift +++ b/MVMCoreUI/Templates/StackPageTemplateModel.swift @@ -13,9 +13,7 @@ import Foundation public static var identifier: String = "stack" public var pageType: String - public var screenHeading: String? - public var isAtomicTabs: Bool? public var header: MoleculeProtocol? @@ -27,7 +25,7 @@ import Foundation self.moleculeStack = moleculeStack } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case pageType case screenHeading case header diff --git a/MVMCoreUI/Models/Template/ThreeLayerPageTemplateModel.swift b/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift similarity index 97% rename from MVMCoreUI/Models/Template/ThreeLayerPageTemplateModel.swift rename to MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift index 5d4d1b25..e42ca5f0 100644 --- a/MVMCoreUI/Models/Template/ThreeLayerPageTemplateModel.swift +++ b/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift @@ -12,9 +12,7 @@ import Foundation public static var identifier: String = "threeLayer" public var pageType: String - public var screenHeading: String? - public var isAtomicTabs: Bool? public var header: MoleculeProtocol? @@ -28,7 +26,7 @@ import Foundation self.footer = footer } - enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey { case pageType case screenHeading case header diff --git a/MVMCoreUI/Templates/ThreeLayerTemplate.swift b/MVMCoreUI/Templates/ThreeLayerTemplate.swift index 9c963693..785d1055 100644 --- a/MVMCoreUI/Templates/ThreeLayerTemplate.swift +++ b/MVMCoreUI/Templates/ThreeLayerTemplate.swift @@ -26,7 +26,6 @@ import UIKit heightConstraint?.isActive = true } - open override func viewForTop() -> UIView? { guard let headerModel = templateModel?.header, let molecule = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(headerModel, delegateObject() as? MVMCoreUIDelegateObject, false) else {