Merge branch 'develop' into feature/swiftified_textField
# Conflicts: # MVMCoreUI.xcodeproj/project.pbxproj
This commit is contained in:
commit
d15d8b2636
@ -7,10 +7,16 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
01004F3022721C3800991ECC /* RadioButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01004F2F22721C3800991ECC /* RadioButton.swift */; };
|
||||
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618A224BBE7700E1557D /* FormValidator.swift */; };
|
||||
0105618E224BBE7700E1557D /* FormValidator+TextFields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */; };
|
||||
0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */; };
|
||||
016A1071228122180009D605 /* HeadlineBodyTextButtonSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016A1070228122180009D605 /* HeadlineBodyTextButtonSwitch.swift */; };
|
||||
0116A4E5228B19640094F3ED /* RadioButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0116A4E4228B19640094F3ED /* RadioButtonModel.swift */; };
|
||||
01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01509D8E2327EC6F00EF99AA /* MoleculeTableViewCell.swift */; };
|
||||
01509D912327ECE600EF99AA /* CornerLabels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01509D902327ECE600EF99AA /* CornerLabels.swift */; };
|
||||
01509D932327ECFB00EF99AA /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01509D922327ECFB00EF99AA /* ProgressBar.swift */; };
|
||||
01509D952327ED1900EF99AA /* HeadlineBodyTextButtonSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01509D942327ED1900EF99AA /* HeadlineBodyTextButtonSwitch.swift */; };
|
||||
017BEB382360C6AC0024EF95 /* RadioButtonLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 017BEB372360C6AC0024EF95 /* RadioButtonLabel.swift */; };
|
||||
0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0198F79E225679870066C936 /* FormValidationProtocol.swift */; };
|
||||
0198F7A62256A80B0066C936 /* MFRadioButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 0198F7A02256A80A0066C936 /* MFRadioButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0198F7A82256A80B0066C936 /* MFRadioButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 0198F7A22256A80A0066C936 /* MFRadioButton.m */; };
|
||||
@ -37,11 +43,10 @@
|
||||
0A41BA6E2344FCD400D4C0BC /* CATransaction+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A41BA6D2344FCD400D4C0BC /* CATransaction+Extension.swift */; };
|
||||
0A41BA7F23453A6400D4C0BC /* TextEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A41BA7E23453A6400D4C0BC /* TextEntryField.swift */; };
|
||||
0A6BF4722360C56C0028F841 /* DropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A6BF4712360C56C0028F841 /* DropdownEntryField.swift */; };
|
||||
0A7BAD74232A8DC700FB8E22 /* HeadlineBodyButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7BAD73232A8DC700FB8E22 /* HeadlineBodyButton.swift */; };
|
||||
0A7BAFA1232BE61800FB8E22 /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */; };
|
||||
9455B19C234F8A0400A574DB /* MVMAnimationFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9455B19B234F8A0400A574DB /* MVMAnimationFramework.framework */; };
|
||||
948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 948DB67D2326DCD90011F916 /* MultiProgress.swift */; };
|
||||
B8200E152280C4CF007245F4 /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8200E142280C4CF007245F4 /* ProgressBar.swift */; };
|
||||
B8200E192281DC1A007245F4 /* CornerLabels.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8200E182281DC1A007245F4 /* CornerLabels.swift */; };
|
||||
D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
D206997821FB8A0B00CAE0DE /* MVMCoreUINavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationController.m */; };
|
||||
D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D20A9A5D2243D3E300ADE781 /* TwoButtonView.swift */; };
|
||||
@ -184,13 +189,14 @@
|
||||
D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A638FC22CA98280052ED1F /* HeadlineBody.swift */; };
|
||||
D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390022CBB1820052ED1F /* Carousel.swift */; };
|
||||
D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */; };
|
||||
D2B18B7F2360913400A9AEDC /* Control.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B18B7E2360913400A9AEDC /* Control.swift */; };
|
||||
D2B18B812360945C00A9AEDC /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B18B802360945C00A9AEDC /* View.swift */; };
|
||||
D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */; };
|
||||
D2C5001821F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */; };
|
||||
D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */; };
|
||||
D2D6CD4222E78FAB00D701B8 /* ThreeLayerTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D6CD4122E78FAB00D701B8 /* ThreeLayerTemplate.swift */; };
|
||||
D2E1FADB2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FADA2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift */; };
|
||||
D2E1FADD2268B25E00AEFD8C /* MoleculeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FADC2268B25E00AEFD8C /* MoleculeTableViewCell.swift */; };
|
||||
D2E1FADF2268B8E700AEFD8C /* ThreeLayerTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FADE2268B8E700AEFD8C /* ThreeLayerTableViewController.swift */; };
|
||||
D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FAE02268E81D00AEFD8C /* MoleculeListTemplate.swift */; };
|
||||
DB06250B2293456500B72DD3 /* LeftRightLabelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB06250A2293456500B72DD3 /* LeftRightLabelView.swift */; };
|
||||
@ -202,10 +208,16 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
01004F2F22721C3800991ECC /* RadioButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioButton.swift; sourceTree = "<group>"; };
|
||||
0105618A224BBE7700E1557D /* FormValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidator.swift; sourceTree = "<group>"; };
|
||||
0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+TextFields.swift"; sourceTree = "<group>"; };
|
||||
0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+FormParams.swift"; sourceTree = "<group>"; };
|
||||
016A1070228122180009D605 /* HeadlineBodyTextButtonSwitch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBodyTextButtonSwitch.swift; sourceTree = "<group>"; };
|
||||
0116A4E4228B19640094F3ED /* RadioButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioButtonModel.swift; sourceTree = "<group>"; };
|
||||
01509D8E2327EC6F00EF99AA /* MoleculeTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeTableViewCell.swift; sourceTree = "<group>"; };
|
||||
01509D902327ECE600EF99AA /* CornerLabels.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CornerLabels.swift; sourceTree = "<group>"; };
|
||||
01509D922327ECFB00EF99AA /* ProgressBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgressBar.swift; sourceTree = "<group>"; };
|
||||
01509D942327ED1900EF99AA /* HeadlineBodyTextButtonSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeadlineBodyTextButtonSwitch.swift; sourceTree = "<group>"; };
|
||||
017BEB372360C6AC0024EF95 /* RadioButtonLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioButtonLabel.swift; sourceTree = "<group>"; };
|
||||
0198F79E225679870066C936 /* FormValidationProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormValidationProtocol.swift; sourceTree = "<group>"; };
|
||||
0198F7A02256A80A0066C936 /* MFRadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFRadioButton.h; sourceTree = "<group>"; };
|
||||
0198F7A22256A80A0066C936 /* MFRadioButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFRadioButton.m; sourceTree = "<group>"; };
|
||||
@ -218,13 +230,12 @@
|
||||
0A41BA6D2344FCD400D4C0BC /* CATransaction+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CATransaction+Extension.swift"; sourceTree = "<group>"; };
|
||||
0A41BA7E23453A6400D4C0BC /* TextEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextEntryField.swift; sourceTree = "<group>"; };
|
||||
0A6BF4712360C56C0028F841 /* DropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownEntryField.swift; sourceTree = "<group>"; };
|
||||
0A7BAD73232A8DC700FB8E22 /* HeadlineBodyButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBodyButton.swift; sourceTree = "<group>"; };
|
||||
0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = "<group>"; };
|
||||
0A7BAFA2232BE63400FB8E22 /* CheckboxWithLabelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckboxWithLabelView.swift; sourceTree = "<group>"; };
|
||||
0A8321AE2355FE9500CB7F00 /* DigitBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DigitBox.swift; sourceTree = "<group>"; };
|
||||
9455B19B234F8A0400A574DB /* MVMAnimationFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MVMAnimationFramework.framework; path = ../SharedFrameworks/MVMAnimationFramework.framework; sourceTree = "<group>"; };
|
||||
948DB67D2326DCD90011F916 /* MultiProgress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiProgress.swift; sourceTree = "<group>"; };
|
||||
B8200E142280C4CF007245F4 /* ProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressBar.swift; sourceTree = "<group>"; };
|
||||
B8200E182281DC1A007245F4 /* CornerLabels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CornerLabels.swift; sourceTree = "<group>"; };
|
||||
D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUINavigationController.h; sourceTree = "<group>"; };
|
||||
D206997621FB8A0B00CAE0DE /* MVMCoreUINavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUINavigationController.m; sourceTree = "<group>"; };
|
||||
D20A9A5D2243D3E300ADE781 /* TwoButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwoButtonView.swift; sourceTree = "<group>"; };
|
||||
@ -382,13 +393,14 @@
|
||||
D2A638FC22CA98280052ED1F /* HeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBody.swift; sourceTree = "<group>"; };
|
||||
D2A6390022CBB1820052ED1F /* Carousel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carousel.swift; sourceTree = "<group>"; };
|
||||
D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeCollectionViewCell.swift; sourceTree = "<group>"; };
|
||||
D2B18B7E2360913400A9AEDC /* Control.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Control.swift; sourceTree = "<group>"; };
|
||||
D2B18B802360945C00A9AEDC /* View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.swift; sourceTree = "<group>"; };
|
||||
D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageHeadlineBody.swift; sourceTree = "<group>"; };
|
||||
D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIViewControllerMappingObject.h; sourceTree = "<group>"; };
|
||||
D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIViewControllerMappingObject.m; sourceTree = "<group>"; };
|
||||
D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scroller.swift; sourceTree = "<group>"; };
|
||||
D2D6CD4122E78FAB00D701B8 /* ThreeLayerTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerTemplate.swift; sourceTree = "<group>"; };
|
||||
D2E1FADA2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUIDelegateObject.swift; sourceTree = "<group>"; };
|
||||
D2E1FADC2268B25E00AEFD8C /* MoleculeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeTableViewCell.swift; sourceTree = "<group>"; };
|
||||
D2E1FADE2268B8E700AEFD8C /* ThreeLayerTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerTableViewController.swift; sourceTree = "<group>"; };
|
||||
D2E1FAE02268E81D00AEFD8C /* MoleculeListTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeListTemplate.swift; sourceTree = "<group>"; };
|
||||
DB06250A2293456500B72DD3 /* LeftRightLabelView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeftRightLabelView.swift; sourceTree = "<group>"; };
|
||||
@ -426,9 +438,9 @@
|
||||
D224798823142BF2003FCCF9 /* SwitchMolecules */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
01509D942327ED1900EF99AA /* HeadlineBodyTextButtonSwitch.swift */,
|
||||
D22479892314445E003FCCF9 /* LabelSwitch.swift */,
|
||||
D224798B231450C8003FCCF9 /* HeadlineBodySwitch.swift */,
|
||||
016A1070228122180009D605 /* HeadlineBodyTextButtonSwitch.swift */,
|
||||
);
|
||||
path = SwitchMolecules;
|
||||
sourceTree = "<group>";
|
||||
@ -455,8 +467,8 @@
|
||||
D224798F2316A99F003FCCF9 /* LeftRightViews */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
01509D902327ECE600EF99AA /* CornerLabels.swift */,
|
||||
D224798823142BF2003FCCF9 /* SwitchMolecules */,
|
||||
B8200E182281DC1A007245F4 /* CornerLabels.swift */,
|
||||
);
|
||||
path = LeftRightViews;
|
||||
sourceTree = "<group>";
|
||||
@ -473,8 +485,8 @@
|
||||
D22479912316A9EF003FCCF9 /* Items */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
01509D8E2327EC6F00EF99AA /* MoleculeTableViewCell.swift */,
|
||||
D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */,
|
||||
D2E1FADC2268B25E00AEFD8C /* MoleculeTableViewCell.swift */,
|
||||
D224799A231965AD003FCCF9 /* AccordionMoleculeTableViewCell.swift */,
|
||||
D27CD40D2322EEAF00C1DC07 /* TabsTableViewCell.swift */,
|
||||
);
|
||||
@ -514,6 +526,7 @@
|
||||
D29DF0CE21E404D4003B2FB9 /* MVMCoreUI */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2B18B7D236090D500A9AEDC /* BaseClasses */,
|
||||
01C74D87224298E2009C25A3 /* FormUIHelpers */,
|
||||
D29DF31421ECECA7003B2FB9 /* SupportingFiles */,
|
||||
D29DF27021E79B2C003B2FB9 /* OtherHandlers */,
|
||||
@ -569,6 +582,7 @@
|
||||
D29DF10E21E67A77003B2FB9 /* Molecules */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
017BEB372360C6AC0024EF95 /* RadioButtonLabel.swift */,
|
||||
D22479912316A9EF003FCCF9 /* Items */,
|
||||
D224798F2316A99F003FCCF9 /* LeftRightViews */,
|
||||
D224798E2316A995003FCCF9 /* HorizontalCombinationViews */,
|
||||
@ -580,8 +594,10 @@
|
||||
D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */,
|
||||
D2A514662213885800345BFB /* StandardHeaderView.swift */,
|
||||
D274CA322236A78900B01B62 /* StandardFooterView.swift */,
|
||||
0116A4E4228B19640094F3ED /* RadioButtonModel.swift */,
|
||||
D29B770F22C281F400D6ACE0 /* ModuleMolecule.swift */,
|
||||
D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */,
|
||||
0A7BAD73232A8DC700FB8E22 /* HeadlineBodyButton.swift */,
|
||||
);
|
||||
path = Molecules;
|
||||
sourceTree = "<group>";
|
||||
@ -704,10 +720,10 @@
|
||||
D29DF17D21E69E26003B2FB9 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
01509D922327ECFB00EF99AA /* ProgressBar.swift */,
|
||||
D260D7AF22D65BDD007E7233 /* MVMCoreUIPageControl.h */,
|
||||
D260D7B022D65BDD007E7233 /* MVMCoreUIPageControl.m */,
|
||||
D260D7B522D68509007E7233 /* MVMCoreUIPagingProtocol.h */,
|
||||
B8200E142280C4CF007245F4 /* ProgressBar.swift */,
|
||||
948DB67D2326DCD90011F916 /* MultiProgress.swift */,
|
||||
DBC4391622442196001AB423 /* CaretView.swift */,
|
||||
DBC4391722442197001AB423 /* DashLine.swift */,
|
||||
@ -743,6 +759,7 @@
|
||||
0198F7A22256A80A0066C936 /* MFRadioButton.m */,
|
||||
0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */,
|
||||
0A7BAFA2232BE63400FB8E22 /* CheckboxWithLabelView.swift */,
|
||||
01004F2F22721C3800991ECC /* RadioButton.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
@ -867,6 +884,15 @@
|
||||
path = Strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2B18B7D236090D500A9AEDC /* BaseClasses */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D2B18B7E2360913400A9AEDC /* Control.swift */,
|
||||
D2B18B802360945C00A9AEDC /* View.swift */,
|
||||
);
|
||||
path = BaseClasses;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
@ -1032,13 +1058,18 @@
|
||||
D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */,
|
||||
D29B771022C281F400D6ACE0 /* ModuleMolecule.swift in Sources */,
|
||||
DBC4391922442197001AB423 /* DashLine.swift in Sources */,
|
||||
0A7BAD74232A8DC700FB8E22 /* HeadlineBodyButton.swift in Sources */,
|
||||
D29DF29621E7ADB8003B2FB9 /* StackableViewController.m in Sources */,
|
||||
0116A4E5228B19640094F3ED /* RadioButtonModel.swift in Sources */,
|
||||
D2E1FADB2260D3D200AEFD8C /* MVMCoreUIDelegateObject.swift in Sources */,
|
||||
D27CD40E2322EEAF00C1DC07 /* TabsTableViewCell.swift in Sources */,
|
||||
D224799B231965AD003FCCF9 /* AccordionMoleculeTableViewCell.swift in Sources */,
|
||||
D22D1F1F220343560077CEC0 /* MVMCoreUICheckMarkView.m in Sources */,
|
||||
01004F3022721C3800991ECC /* RadioButton.swift in Sources */,
|
||||
D282AAB4223FDDAE00C46919 /* MFLoadImageView.swift in Sources */,
|
||||
D29DF11721E6805F003B2FB9 /* UIColor+MFConvenience.m in Sources */,
|
||||
D29DF25321E6A177003B2FB9 /* MFDigitTextField.m in Sources */,
|
||||
D2B18B7F2360913400A9AEDC /* Control.swift in Sources */,
|
||||
D29DF12F21E6851E003B2FB9 /* MVMCoreUITopAlertMainView.m in Sources */,
|
||||
DBC4392122491730001AB423 /* LabelWithInternalButton.swift in Sources */,
|
||||
D224798C231450C8003FCCF9 /* HeadlineBodySwitch.swift in Sources */,
|
||||
@ -1058,15 +1089,18 @@
|
||||
D29DF12B21E6851E003B2FB9 /* MVMCoreUITopAlertExpandableView.m in Sources */,
|
||||
0A21DB85235E06EF00C160A2 /* MFTextField.m in Sources */,
|
||||
B8200E152280C4CF007245F4 /* ProgressBar.swift in Sources */,
|
||||
D29DF25421E6A177003B2FB9 /* MFMdnTextField.m in Sources */,
|
||||
D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */,
|
||||
D2A514672213885800345BFB /* StandardHeaderView.swift in Sources */,
|
||||
DBEFFA04225A829700230692 /* Label.swift in Sources */,
|
||||
D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */,
|
||||
01509D952327ED1900EF99AA /* HeadlineBodyTextButtonSwitch.swift in Sources */,
|
||||
D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */,
|
||||
D28B4F8B21FF967C00712C7A /* MVMCoreUIObject.m in Sources */,
|
||||
0A1B4A96233BB18F005B3FB4 /* CheckboxWithLabelView.swift in Sources */,
|
||||
0A21DB8B235E06EF00C160A2 /* MFDigitTextBox.m in Sources */,
|
||||
D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */,
|
||||
D2B18B812360945C00A9AEDC /* View.swift in Sources */,
|
||||
D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */,
|
||||
D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */,
|
||||
D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */,
|
||||
@ -1075,9 +1109,9 @@
|
||||
0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */,
|
||||
0A7BAFA1232BE61800FB8E22 /* Checkbox.swift in Sources */,
|
||||
D22479962316AF6E003FCCF9 /* HeadlineBodyTextButton.swift in Sources */,
|
||||
D2E1FADD2268B25E00AEFD8C /* MoleculeTableViewCell.swift in Sources */,
|
||||
D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */,
|
||||
0A41BA7F23453A6400D4C0BC /* TextEntryField.swift in Sources */,
|
||||
017BEB382360C6AC0024EF95 /* RadioButtonLabel.swift in Sources */,
|
||||
D29DF18121E69E50003B2FB9 /* MFView.m in Sources */,
|
||||
D29DF18321E69E54003B2FB9 /* SeparatorView.m in Sources */,
|
||||
D29DF17A21E69E1F003B2FB9 /* MFCustomButton.m in Sources */,
|
||||
@ -1092,7 +1126,6 @@
|
||||
D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */,
|
||||
D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */,
|
||||
D29DF2C721E7BF57003B2FB9 /* MFTabBarInteractor.m in Sources */,
|
||||
016A1071228122180009D605 /* HeadlineBodyTextButtonSwitch.swift in Sources */,
|
||||
D29DF29521E7ADB8003B2FB9 /* ProgrammaticScrollViewController.m in Sources */,
|
||||
D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */,
|
||||
D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */,
|
||||
@ -1132,11 +1165,13 @@
|
||||
D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */,
|
||||
D29DF32421ED0DA2003B2FB9 /* TextButtonView.m in Sources */,
|
||||
D29DF29E21E7AE3B003B2FB9 /* MFStyler.m in Sources */,
|
||||
B8200E192281DC1A007245F4 /* CornerLabels.swift in Sources */,
|
||||
D2A514592211C53C00345BFB /* MVMCoreUIMoleculeMappingObject.m in Sources */,
|
||||
01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */,
|
||||
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */,
|
||||
01509D912327ECE600EF99AA /* CornerLabels.swift in Sources */,
|
||||
D22D1F1B220341F60077CEC0 /* MVMCoreUICheckBox.m in Sources */,
|
||||
D29DF2CB21E7BFCC003B2FB9 /* MFSizeThreshold.m in Sources */,
|
||||
01509D932327ECFB00EF99AA /* ProgressBar.swift in Sources */,
|
||||
D29770F521F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsViewController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
@ -13,13 +13,15 @@
|
||||
#import "MFStyler.h"
|
||||
#import "UIColor+MFConvenience.h"
|
||||
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
||||
|
||||
@import MVMCore.MVMCoreDispatchUtility;
|
||||
@import MVMCore.MVMCoreGetterUtility;
|
||||
@import MVMCore.NSDictionary_MFConvenience;
|
||||
|
||||
@interface PrimaryButton() <FormValidationProtocol>
|
||||
@interface PrimaryButton() <FormValidationEnableDisableProtocol>
|
||||
|
||||
@property (nonatomic) BOOL validationRequired;
|
||||
@property (nonatomic, strong) NSArray *requiredGroupsList;
|
||||
@property (nonatomic) BOOL smallButton;
|
||||
@property (assign, nonatomic) BOOL tinyButton;
|
||||
@property (nonatomic) CGFloat sizeForSizing;
|
||||
@ -666,6 +668,9 @@
|
||||
}
|
||||
|
||||
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
||||
|
||||
self.validationRequired = [json boolForKey:@"validationRequired"];
|
||||
self.requiredGroupsList = [json array:@"requiredGroups"];
|
||||
[FormValidator setupValidationWithMolecule:self delegate:delegateObject.formValidationProtocol];
|
||||
|
||||
self.primaryButtonType = PrimaryButtonTypeCustom;
|
||||
@ -696,7 +701,6 @@
|
||||
if ((color = [json string:@"disabledBorderColor"])) {
|
||||
self.disabledBorderColor = [UIColor mfGetColorForHex:color];
|
||||
}
|
||||
self.validationRequired = [json boolForKey:@"validationRequired"];
|
||||
|
||||
NSString *size = [json string:@"size"];
|
||||
if ([size isEqualToString:@"small"]) {
|
||||
@ -773,7 +777,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - FormValidationProtocol
|
||||
#pragma mark - FormValidationEnableDisableProtocol
|
||||
|
||||
- (BOOL)isValidationRequired {
|
||||
return self.validationRequired;
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)requiredGroups {
|
||||
return self.requiredGroupsList;
|
||||
}
|
||||
|
||||
- (void)enableField:(BOOL)enable {
|
||||
if (!self.validationRequired) {
|
||||
|
||||
@ -46,7 +46,8 @@
|
||||
// To set the placeholder and text
|
||||
@property (nullable, weak, nonatomic) NSString *text;
|
||||
@property (nullable, weak, nonatomic) NSString *formText;
|
||||
@property (nullable, weak, nonatomic) NSString *fieldKey;
|
||||
@property (nullable, strong, nonatomic) NSString *fieldKey;
|
||||
@property (nullable, strong, nonatomic) NSString *groupName;
|
||||
|
||||
@property (nullable, weak, nonatomic) NSString *placeholder; // will move out in Feb release
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
@import MVMCore.NSDictionary_MFConvenience;
|
||||
@import MVMCore.MVMCoreJSONConstants;
|
||||
|
||||
@interface MFTextField() <FormValidationProtocol>
|
||||
@interface MFTextField() <FormValidationFormFieldProtocol>
|
||||
|
||||
@property (strong, nonatomic) UIColor *customPlaceHolderColor;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *separatorHeightConstraint;
|
||||
@ -317,12 +317,14 @@
|
||||
if (string.length > 0) {
|
||||
self.errMessage = string;
|
||||
}
|
||||
|
||||
|
||||
// key used to send text value to server
|
||||
string = [map string:KeyFieldKey];
|
||||
if (string.length > 0) {
|
||||
self.fieldKey = string;
|
||||
}
|
||||
|
||||
self.groupName = [map string:@"groupName"];
|
||||
|
||||
string = [map string:KeyType];
|
||||
if ([string isEqualToString:@"dropDown"]) {
|
||||
@ -586,5 +588,9 @@
|
||||
- (nullable id)formFieldValue {
|
||||
return self.text;
|
||||
}
|
||||
|
||||
|
||||
- (NSString * _Nullable)formFieldGroupName {
|
||||
return self.groupName;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -308,7 +308,7 @@ public typealias ActionBlock = () -> ()
|
||||
guard let actionLabel = label as? Label else { continue }
|
||||
|
||||
actionLabel.addActionAttributes(range: range, string: attributedString)
|
||||
let actionBlock = actionLabel.createActionBlockFrom(actionMap: json, additionalData: additionalData, delegateObject: delegate)
|
||||
let actionBlock = actionLabel.createActionBlockFrom(actionMap: attribute, additionalData: additionalData, delegateObject: delegate)
|
||||
actionLabel.appendActionableClause(range: range, actionBlock: actionBlock)
|
||||
|
||||
default:
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
static const CGFloat FaultTolerance = 20.f;
|
||||
static const CGFloat CheckBoxHeightWidth = 18.0;
|
||||
|
||||
@interface MVMCoreUICheckBox () <FormValidationProtocol, MVMCoreUIMoleculeViewProtocol>
|
||||
@interface MVMCoreUICheckBox () <FormValidationFormFieldProtocol, MVMCoreUIMoleculeViewProtocol>
|
||||
|
||||
@property (nonatomic, readwrite) BOOL isSelected;
|
||||
@property (weak, nonatomic) UIView *checkedSquare;
|
||||
@ -42,7 +42,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
||||
|
||||
@property (nonatomic) BOOL isRequired;
|
||||
@property (nullable, strong, nonatomic) NSString *fieldKey;
|
||||
@property (nullable, strong, nonatomic) DelegateObject *delegate;
|
||||
@property (nullable, strong, nonatomic) MVMCoreUIDelegateObject *delegateObject;
|
||||
|
||||
@end
|
||||
|
||||
@ -61,7 +61,8 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
||||
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
||||
|
||||
[FormValidator setupValidationWithMolecule:self delegate:delegateObject.formValidationProtocol];
|
||||
self.delegate = delegateObject;
|
||||
|
||||
self.delegateObject = delegateObject;
|
||||
self.fieldKey = [json stringForKey:KeyFieldKey];
|
||||
self.isRequired = [json boolForKey:KeyRequired];
|
||||
|
||||
@ -347,10 +348,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
||||
[self.checkMark updateCheckSelected:NO animated:animated];
|
||||
}
|
||||
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(formValidationProtocol)] && [[self.delegate performSelector:@selector(formValidationProtocol)] respondsToSelector:@selector(formValidatorModel)]) {
|
||||
FormValidator *formValidator = [[self.delegate performSelector:@selector(formValidationProtocol)] performSelector:@selector(formValidatorModel)];
|
||||
[formValidator enableByValidation];
|
||||
}
|
||||
[FormValidator enableByValidationWithDelegate:self.delegateObject.formValidationProtocol];
|
||||
}
|
||||
|
||||
- (void)setColor:(nullable UIColor *)color forState:(UIControlState)state {
|
||||
|
||||
135
MVMCoreUI/Atoms/Views/RadioButton.swift
Normal file
135
MVMCoreUI/Atoms/Views/RadioButton.swift
Normal file
@ -0,0 +1,135 @@
|
||||
//
|
||||
// RadioButton.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Suresh, Kamlesh on 4/25/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class RadioButton: Control, FormValidationFormFieldProtocol {
|
||||
|
||||
var diameter: CGFloat = 30 {
|
||||
didSet {
|
||||
widthConstraint?.constant = diameter
|
||||
}
|
||||
}
|
||||
var enabledColor = UIColor.black
|
||||
var disabledColor = UIColor.mfSilver()
|
||||
|
||||
var delegateObject: MVMCoreUIDelegateObject?
|
||||
|
||||
var fieldKey: String?
|
||||
var formValue: Bool?
|
||||
var isRequired: Bool = false
|
||||
|
||||
var widthConstraint: NSLayoutConstraint?
|
||||
var heightConstraint: NSLayoutConstraint?
|
||||
|
||||
lazy var radioGroupName: String? = {
|
||||
[unowned self] in
|
||||
return json?.optionalStringForKey("radioGroupName") ?? json?.optionalStringForKey("fieldKey")
|
||||
}()
|
||||
|
||||
lazy var radioButtonModel: RadioButtonModel? = {
|
||||
[unowned self] in
|
||||
if let radioGroupName = radioGroupName,
|
||||
let radioButtonModel = delegateObject?.formValidationProtocol?.formValidatorModel?()?.radioButtonsModelByGroup[radioGroupName] {
|
||||
return radioButtonModel
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
|
||||
open override func draw(_ rect: CGRect) {
|
||||
guard let context = UIGraphicsGetCurrentContext() else { return }
|
||||
let color = isEnabled ? enabledColor.cgColor : disabledColor.cgColor
|
||||
layer.cornerRadius = bounds.width * 0.5
|
||||
layer.borderColor = color
|
||||
layer.borderWidth = bounds.width * 0.0333
|
||||
if isSelected {
|
||||
// Space around inner circle is 1/5 the size
|
||||
context.addEllipse(in: CGRect(x: bounds.width*0.2, y: bounds.height*0.2, width: bounds.width*0.6, height: bounds.height*0.6))
|
||||
context.setFillColor(color)
|
||||
context.fillPath()
|
||||
}
|
||||
}
|
||||
|
||||
/// The action performed when tapped.
|
||||
func tapAction() {
|
||||
if let radioButtonModel = radioButtonModel {
|
||||
radioButtonModel.selected(self)
|
||||
} else {
|
||||
isSelected = !isSelected
|
||||
}
|
||||
FormValidator.enableByValidationWith(delegate: delegateObject?.formValidationProtocol)
|
||||
setNeedsDisplay()
|
||||
}
|
||||
|
||||
public func isValidField() -> Bool {
|
||||
return isSelected
|
||||
}
|
||||
|
||||
public func formFieldName() -> String? {
|
||||
return json?.optionalStringForKey("fieldKey")
|
||||
}
|
||||
|
||||
public func formFieldGroupName() -> String? {
|
||||
return json?.optionalStringForKey("groupName")
|
||||
}
|
||||
|
||||
public func formFieldValue() -> Any? {
|
||||
return isSelected
|
||||
}
|
||||
|
||||
// MARK: - MVMViewProtocol
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
backgroundColor = .white
|
||||
clipsToBounds = true
|
||||
widthConstraint = widthAnchor.constraint(equalToConstant: 30)
|
||||
widthConstraint?.isActive = true
|
||||
heightConstraint = heightAnchor.constraint(equalTo: widthAnchor, multiplier: 1)
|
||||
heightConstraint?.isActive = true
|
||||
|
||||
addTarget(self, action: #selector(tapAction), for: .touchUpInside)
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .button
|
||||
accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIViewConstrainingProtocol
|
||||
extension RadioButton: MVMCoreUIViewConstrainingProtocol {
|
||||
public func needsToBeConstrained() -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
extension RadioButton {
|
||||
|
||||
@objc open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
|
||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||
|
||||
// Configure class properties with JSON values
|
||||
guard let jsonDictionary = json else {
|
||||
return
|
||||
}
|
||||
|
||||
fieldKey = jsonDictionary.optionalStringForKey("fieldKey")
|
||||
isRequired = jsonDictionary.boolForKey("required")
|
||||
self.delegateObject = delegateObject
|
||||
|
||||
let radioButtonModel = RadioButtonModel.setupForRadioButtonGroup(radioButton: self,
|
||||
formValidator: delegateObject?.formValidationProtocol?.formValidatorModel?())
|
||||
FormValidator.setupValidation(molecule: radioButtonModel, delegate: delegateObject?.formValidationProtocol)
|
||||
}
|
||||
|
||||
public override func reset() {
|
||||
super.reset()
|
||||
backgroundColor = .white
|
||||
}
|
||||
}
|
||||
@ -314,14 +314,10 @@
|
||||
[self.molecule updateView:size];
|
||||
[MFStyler setMarginsForView:self size:size defaultHorizontal:self.updateViewHorizontalDefaults top:(self.updateViewVerticalDefaults ? self.topMarginPadding : 0) bottom:(self.updateViewVerticalDefaults ? self.bottomMarginPadding : 0)];
|
||||
UIEdgeInsets margins = [MVMCoreUIUtility getMarginsForView:self];
|
||||
if (self.updateViewHorizontalDefaults) {
|
||||
[self setLeftPinConstant:margins.left];
|
||||
[self setRightPinConstant:margins.right];
|
||||
}
|
||||
if (self.updateViewVerticalDefaults) {
|
||||
[self setTopPinConstant:margins.top];
|
||||
[self setBottomPinConstant:margins.bottom];
|
||||
}
|
||||
[self setLeftPinConstant:margins.left];
|
||||
[self setRightPinConstant:margins.right];
|
||||
[self setTopPinConstant:margins.top];
|
||||
[self setBottomPinConstant:margins.bottom];
|
||||
}
|
||||
|
||||
#pragma mark - MVMCoreUIMoleculeViewProtocol
|
||||
|
||||
62
MVMCoreUI/BaseClasses/Control.swift
Normal file
62
MVMCoreUI/BaseClasses/Control.swift
Normal file
@ -0,0 +1,62 @@
|
||||
//
|
||||
// Control.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Scott Pfeil on 10/23/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class Control: UIControl {
|
||||
var json: [AnyHashable: Any]?
|
||||
|
||||
private var initialSetupPerformed = false
|
||||
|
||||
public override init(frame: CGRect) {
|
||||
super.init(frame: .zero)
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
init() {
|
||||
super.init(frame: .zero)
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
public func initialSetup() {
|
||||
if !initialSetupPerformed {
|
||||
initialSetupPerformed = true
|
||||
setupView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Control: MVMCoreViewProtocol {
|
||||
public func updateView(_ size: CGFloat) {
|
||||
}
|
||||
|
||||
/// Will be called only once.
|
||||
public func setupView() {
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
insetsLayoutMarginsFromSafeArea = false
|
||||
}
|
||||
}
|
||||
|
||||
extension Control: MVMCoreUIMoleculeViewProtocol {
|
||||
public func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
|
||||
self.json = json
|
||||
|
||||
if let backgroundColorString = json?.optionalStringForKey(KeyBackgroundColor) {
|
||||
backgroundColor = UIColor.mfGet(forHex: backgroundColorString)
|
||||
}
|
||||
}
|
||||
|
||||
public func reset() {
|
||||
backgroundColor = .clear
|
||||
}
|
||||
}
|
||||
62
MVMCoreUI/BaseClasses/View.swift
Normal file
62
MVMCoreUI/BaseClasses/View.swift
Normal file
@ -0,0 +1,62 @@
|
||||
//
|
||||
// View.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Scott Pfeil on 10/23/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class View: UIView {
|
||||
var json: [AnyHashable: Any]?
|
||||
|
||||
private var initialSetupPerformed = false
|
||||
|
||||
public override init(frame: CGRect) {
|
||||
super.init(frame: .zero)
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
init() {
|
||||
super.init(frame: .zero)
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
public func initialSetup() {
|
||||
if !initialSetupPerformed {
|
||||
initialSetupPerformed = true
|
||||
setupView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension View: MVMCoreViewProtocol {
|
||||
public func updateView(_ size: CGFloat) {
|
||||
}
|
||||
|
||||
/// Will be called only once.
|
||||
public func setupView() {
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
insetsLayoutMarginsFromSafeArea = false
|
||||
}
|
||||
}
|
||||
|
||||
extension View: MVMCoreUIMoleculeViewProtocol {
|
||||
public func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
|
||||
self.json = json
|
||||
|
||||
if let backgroundColorString = json?.optionalStringForKey(KeyBackgroundColor) {
|
||||
backgroundColor = UIColor.mfGet(forHex: backgroundColorString)
|
||||
}
|
||||
}
|
||||
|
||||
public func reset() {
|
||||
backgroundColor = .clear
|
||||
}
|
||||
}
|
||||
@ -10,18 +10,32 @@ import Foundation
|
||||
|
||||
@objc public protocol FormValidationProtocol: NSObjectProtocol {
|
||||
|
||||
// Getter method to get the FormValidator form the delegate (Mostly from the parent View Controller)
|
||||
// Getter method to get the FormValidator from the delegate (Mostly from the parent View Controller)
|
||||
@objc optional func formValidatorModel() -> FormValidator?
|
||||
}
|
||||
|
||||
@objc public protocol FormValidationFormFieldProtocol: FormValidationProtocol {
|
||||
// Used to check the validity of the field. For example, to enable/disable the primary button.
|
||||
@objc func isValidField() -> Bool
|
||||
|
||||
// Used to check the validity of the field, to enable/disable the primary button.
|
||||
@objc optional func isValidField() -> Bool
|
||||
// The Field name key value pair for sending to server
|
||||
@objc func formFieldName() -> String?
|
||||
|
||||
// Returns the group name for validation. The class should always return a value.
|
||||
@objc func formFieldGroupName() -> String?
|
||||
|
||||
// The Field value key value pair for sending to server
|
||||
@objc func formFieldValue() -> Any?
|
||||
}
|
||||
|
||||
@objc public protocol FormValidationEnableDisableProtocol: FormValidationProtocol {
|
||||
|
||||
// Returns true if the button needs to be enabled/disabled based on the validation
|
||||
@objc func isValidationRequired() -> Bool
|
||||
|
||||
// Based on the isValidField(), the fields which needs to be enabled can call this method
|
||||
@objc optional func enableField(_ enable: Bool)
|
||||
|
||||
// The Field name key value pair for sending to server
|
||||
@objc optional func formFieldName() -> String?
|
||||
|
||||
// The Field value key value pair for sending to server
|
||||
@objc optional func formFieldValue() -> Any?
|
||||
// Returns the list of field keys required to enable/disable
|
||||
@objc optional func requiredGroups() -> [String]?
|
||||
}
|
||||
|
||||
@ -16,13 +16,10 @@ import Foundation
|
||||
@objc func getFormParams() -> [String: Any] {
|
||||
var extraParam: [String: Any] = [:]
|
||||
MVMCoreDispatchUtility.performSyncBlock(onMainThread: {
|
||||
for molecule in self.molecules {
|
||||
if let formFieldName = molecule.formFieldName,
|
||||
let formFieldValue = molecule.formFieldValue,
|
||||
let fieldName = formFieldName(),
|
||||
let fieldValue = formFieldValue() {
|
||||
|
||||
extraParam[fieldName] = fieldValue
|
||||
for molecule in self.fieldMolecules {
|
||||
if let formFieldName = molecule.formFieldName(),
|
||||
let formFieldValue = molecule.formFieldValue() {
|
||||
extraParam[formFieldName] = formFieldValue
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@ -7,52 +7,79 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MVMCore
|
||||
|
||||
@objcMembers public class FormValidator: NSObject {
|
||||
|
||||
var delegate: FormValidationProtocol?
|
||||
var molecules: [UIView & FormValidationProtocol] = []
|
||||
var extraValidationBlock: (() -> Bool)?
|
||||
var dummyGroupName = "dummyGroupName"
|
||||
weak var delegate: FormValidationProtocol?
|
||||
var fieldMolecules: [FormValidationFormFieldProtocol] = []
|
||||
var enableDisableMolecules: [FormValidationEnableDisableProtocol] = []
|
||||
var radioButtonsModelByGroup: [String: RadioButtonModel] = [:]
|
||||
|
||||
public func insertMolecule(_ molecule: UIView & FormValidationProtocol) {
|
||||
molecules.append(molecule)
|
||||
public func insertMolecule(_ molecule: FormValidationProtocol) {
|
||||
if let molecule = molecule as? FormValidationFormFieldProtocol {
|
||||
fieldMolecules.append(molecule)
|
||||
}
|
||||
if let moleculeT = molecule as? FormValidationEnableDisableProtocol,
|
||||
moleculeT.isValidationRequired() {
|
||||
enableDisableMolecules.append(moleculeT)
|
||||
}
|
||||
}
|
||||
|
||||
public static func getFormValidatorFor(delegate: FormValidationProtocol) -> FormValidator? {
|
||||
if let delegateFormValidatorModel = delegate.formValidatorModel,
|
||||
let validator = delegateFormValidatorModel() {
|
||||
return validator
|
||||
} else {
|
||||
return nil
|
||||
public static func enableByValidationWith(delegate: FormValidationProtocol?) {
|
||||
if let delegate = delegate {
|
||||
let formValidator = FormValidator.getFormValidatorFor(delegate: delegate)
|
||||
formValidator?.enableByValidation()
|
||||
}
|
||||
}
|
||||
|
||||
public static func setupValidation(molecule: UIView & FormValidationProtocol, delegate: FormValidationProtocol?) {
|
||||
if let delegateFormValidatorModel = delegate?.formValidatorModel,
|
||||
let validator = delegateFormValidatorModel() {
|
||||
|
||||
public static func getFormValidatorFor(delegate: FormValidationProtocol) -> FormValidator? {
|
||||
return delegate.formValidatorModel?()
|
||||
}
|
||||
|
||||
public static func setupValidation(molecule: FormValidationProtocol, delegate: FormValidationProtocol?) {
|
||||
if let validator = delegate?.formValidatorModel?() {
|
||||
validator.delegate = delegate
|
||||
validator.insertMolecule(molecule)
|
||||
}
|
||||
}
|
||||
|
||||
public func enableByValidation() {
|
||||
for molecule in enableDisableMolecules {
|
||||
var requiredGroups = molecule.requiredGroups?() ?? [dummyGroupName]
|
||||
if requiredGroups.count == 0 {
|
||||
requiredGroups = [dummyGroupName]
|
||||
}
|
||||
enableWithGroups(requiredGroups, molecule)
|
||||
}
|
||||
}
|
||||
|
||||
public func enableWithGroups(_ requiredGroupList: [String], _ enableDisableMolecule: FormValidationEnableDisableProtocol) {
|
||||
let requiredGroupSet = Set(requiredGroupList)
|
||||
var valid = true
|
||||
for molecule in molecules {
|
||||
if let isValidField = molecule.isValidField,
|
||||
isValidField() == false {
|
||||
valid = false
|
||||
for molecule in fieldMolecules {
|
||||
let groupName = molecule.formFieldGroupName() ?? dummyGroupName
|
||||
if requiredGroupSet.contains(groupName) {
|
||||
valid = valid && molecule.isValidField()
|
||||
if valid == false {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
enableDisableMolecule.enableField?(valid)
|
||||
}
|
||||
|
||||
public func enableIgnoreGroupName(_ enableDisableMolecules: FormValidationEnableDisableProtocol) {
|
||||
var valid = true
|
||||
for molecule in fieldMolecules {
|
||||
valid = valid && molecule.isValidField()
|
||||
if (!valid) {
|
||||
break
|
||||
}
|
||||
}
|
||||
let enableField = valid && (extraValidationBlock?() ?? true)
|
||||
shouldEnable(enableField)
|
||||
}
|
||||
|
||||
public func shouldEnable(_ enable: Bool) {
|
||||
for molecule in molecules {
|
||||
if let enableField = molecule.enableField {
|
||||
enableField(enable)
|
||||
}
|
||||
}
|
||||
enableDisableMolecules.enableField?(enableField)
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,10 +14,8 @@ import UIKit
|
||||
// MARK: - Outlets
|
||||
//------------------------------------------------------
|
||||
|
||||
let header = HeadlineBody(frame: .zero)
|
||||
let button = PrimaryButton.primaryTinyButton(false)!
|
||||
let headlineBodyButton = HeadlineBodyButton(frame: .zero)
|
||||
let imageLoader = MFLoadImageView(pinnedEdges: .all)
|
||||
let leftContainer = ViewConstrainingView.empty()
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Properties
|
||||
@ -30,7 +28,6 @@ import UIKit
|
||||
//------------------------------------------------------
|
||||
|
||||
var imageLeadingConstraint: NSLayoutConstraint?
|
||||
var buttonTopConstraint: NSLayoutConstraint?
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Initialization
|
||||
@ -64,33 +61,20 @@ import UIKit
|
||||
|
||||
setDefaultState()
|
||||
|
||||
addSubview(leftContainer)
|
||||
addSubview(imageLoader)
|
||||
leftContainer.addSubview(header)
|
||||
leftContainer.addSubview(button)
|
||||
addSubview(headlineBodyButton)
|
||||
|
||||
leftContainer.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor).isActive = true
|
||||
leftContainer.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor).isActive = true
|
||||
headlineBodyButton.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor).isActive = true
|
||||
headlineBodyButton.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor).isActive = true
|
||||
|
||||
layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: leftContainer.bottomAnchor).isActive = true
|
||||
let leftContainerBottom = leftContainer.bottomAnchor.constraint(equalTo: bottomAnchor)
|
||||
layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: headlineBodyButton.bottomAnchor).isActive = true
|
||||
let leftContainerBottom = headlineBodyButton.bottomAnchor.constraint(equalTo: bottomAnchor)
|
||||
leftContainerBottom.priority = UILayoutPriority(249)
|
||||
leftContainerBottom.isActive = true
|
||||
|
||||
header.topAnchor.constraint(equalTo: leftContainer.topAnchor).isActive = true
|
||||
header.leadingAnchor.constraint(equalTo: leftContainer.leadingAnchor).isActive = true
|
||||
leftContainer.trailingAnchor.constraint(equalTo: header.trailingAnchor).isActive = true
|
||||
|
||||
buttonTopConstraint = button.topAnchor.constraint(equalTo: header.bottomAnchor, constant: buttonHeaderPadding)
|
||||
buttonTopConstraint?.isActive = true
|
||||
|
||||
button.leadingAnchor.constraint(equalTo: leftContainer.leadingAnchor).isActive = true
|
||||
leftContainer.bottomAnchor.constraint(equalTo: button.bottomAnchor).isActive = true
|
||||
leftContainer.trailingAnchor.constraint(greaterThanOrEqualTo: button.trailingAnchor).isActive = true
|
||||
|
||||
imageLoader.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
|
||||
layoutMarginsGuide.trailingAnchor.constraint(equalTo: imageLoader.trailingAnchor).isActive = true
|
||||
imageLeadingConstraint = imageLoader.leadingAnchor.constraint(greaterThanOrEqualTo: leftContainer.trailingAnchor, constant: 16)
|
||||
imageLeadingConstraint = imageLoader.leadingAnchor.constraint(greaterThanOrEqualTo: headlineBodyButton.trailingAnchor, constant: 16)
|
||||
imageLeadingConstraint?.isActive = true
|
||||
imageLoader.topAnchor.constraint(greaterThanOrEqualTo: layoutMarginsGuide.topAnchor).isActive = true
|
||||
|
||||
@ -103,12 +87,8 @@ import UIKit
|
||||
override open func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
|
||||
header.updateView(size)
|
||||
button.updateView(size)
|
||||
headlineBodyButton.updateView(size)
|
||||
imageLoader.updateView(size)
|
||||
leftContainer.updateView(size)
|
||||
|
||||
buttonTopConstraint?.constant = header.hasText() ? buttonHeaderPadding : 0
|
||||
}
|
||||
|
||||
public override static func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
@ -121,10 +101,8 @@ import UIKit
|
||||
|
||||
private func setDefaultState() {
|
||||
|
||||
header.headlineLabel.font = MFStyler.fontH3()
|
||||
header.messageLabel.font = MFStyler.fontB3()
|
||||
button.setAsSecondaryCustom()
|
||||
button.isHidden = false
|
||||
headlineBodyButton.headlineBody.headlineLabel.font = MFStyler.fontH3()
|
||||
headlineBodyButton.headlineBody.messageLabel.font = MFStyler.fontB3()
|
||||
imageLoader.imageView.contentMode = .scaleAspectFit
|
||||
imageLoader.addSizeConstraintsForAspectRatio = true
|
||||
buttonHeaderPadding = PaddingTwo
|
||||
@ -133,8 +111,7 @@ import UIKit
|
||||
override open func reset() {
|
||||
super.reset()
|
||||
|
||||
header.reset()
|
||||
button.reset()
|
||||
headlineBodyButton.reset()
|
||||
imageLeadingConstraint?.constant = 16
|
||||
imageLoader.reset()
|
||||
setDefaultState()
|
||||
@ -143,8 +120,7 @@ import UIKit
|
||||
open override func setAsMolecule() {
|
||||
super.setAsMolecule()
|
||||
|
||||
header.setAsMolecule()
|
||||
button.setAsMolecule()
|
||||
headlineBodyButton.setAsMolecule()
|
||||
imageLoader.setAsMolecule()
|
||||
setDefaultState()
|
||||
}
|
||||
@ -153,18 +129,8 @@ import UIKit
|
||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||
|
||||
guard let dictionary = json else { return }
|
||||
|
||||
if let padding = dictionary.optionalCGFloatForKey("buttonHeaderPadding") {
|
||||
buttonHeaderPadding = padding
|
||||
}
|
||||
|
||||
header.setWithJSON(dictionary.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
headlineBodyButton.setWithJSON(dictionary.optionalDictionaryForKey("headlineBodyButton"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
imageLoader.setWithJSON(dictionary.optionalDictionaryForKey("image"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
|
||||
if let buttonDictionary = dictionary.optionalDictionaryForKey("button") {
|
||||
button.setWithJSON(buttonDictionary, delegateObject: delegateObject, additionalData: additionalData)
|
||||
} else {
|
||||
button.isHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
135
MVMCoreUI/Molecules/HeadlineBodyButton.swift
Normal file
135
MVMCoreUI/Molecules/HeadlineBodyButton.swift
Normal file
@ -0,0 +1,135 @@
|
||||
//
|
||||
// HeadlineBodyButton.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kevin Christiano on 9/12/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
|
||||
@objcMembers open class HeadlineBodyButton: ViewConstrainingView {
|
||||
//------------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//------------------------------------------------------
|
||||
|
||||
let headlineBody = HeadlineBody(frame: .zero)
|
||||
let button = PrimaryButton.primaryTinyButton(false)!
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//------------------------------------------------------
|
||||
|
||||
var buttonHeadlinePadding: CGFloat = 16
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Constraints
|
||||
//------------------------------------------------------
|
||||
|
||||
var buttonTopConstraint: NSLayoutConstraint?
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Initialization
|
||||
//------------------------------------------------------
|
||||
|
||||
public init() {
|
||||
super.init(frame: .zero)
|
||||
}
|
||||
|
||||
public override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
public convenience init(json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
self.init()
|
||||
setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - View Lifecycle
|
||||
//------------------------------------------------------
|
||||
|
||||
override open func setupView() {
|
||||
super.setupView()
|
||||
|
||||
guard subviews.isEmpty else { return }
|
||||
|
||||
defaultState()
|
||||
|
||||
addSubview(headlineBody)
|
||||
addSubview(button)
|
||||
|
||||
headlineBody.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor).isActive = true
|
||||
headlineBody.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor).isActive = true
|
||||
layoutMarginsGuide.trailingAnchor.constraint(equalTo: headlineBody.trailingAnchor).isActive = true
|
||||
|
||||
buttonTopConstraint = button.topAnchor.constraint(equalTo: headlineBody.bottomAnchor, constant: buttonHeadlinePadding)
|
||||
buttonTopConstraint?.isActive = true
|
||||
|
||||
button.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor).isActive = true
|
||||
layoutMarginsGuide.bottomAnchor.constraint(equalTo: button.bottomAnchor).isActive = true
|
||||
layoutMarginsGuide.trailingAnchor.constraint(greaterThanOrEqualTo: button.trailingAnchor).isActive = true
|
||||
}
|
||||
|
||||
override open func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
|
||||
headlineBody.updateView(size)
|
||||
button.updateView(size)
|
||||
|
||||
buttonTopConstraint?.constant = headlineBody.hasText() && !button.isHidden ? buttonHeadlinePadding : 0
|
||||
}
|
||||
|
||||
private func defaultState() {
|
||||
|
||||
headlineBody.headlineLabel.font = MFStyler.fontH3()
|
||||
headlineBody.messageLabel.font = MFStyler.fontB3()
|
||||
button.setAsTiny(true)
|
||||
button.setAsSecondaryCustom()
|
||||
button.isHidden = false
|
||||
buttonHeadlinePadding = PaddingTwo
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Molecule
|
||||
//------------------------------------------------------
|
||||
|
||||
override open func reset() {
|
||||
super.reset()
|
||||
|
||||
headlineBody.reset()
|
||||
button.reset()
|
||||
defaultState()
|
||||
}
|
||||
|
||||
open override func setAsMolecule() {
|
||||
super.setAsMolecule()
|
||||
|
||||
headlineBody.setAsMolecule()
|
||||
button.setAsMolecule()
|
||||
defaultState()
|
||||
}
|
||||
|
||||
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||
|
||||
guard let dictionary = json else { return }
|
||||
|
||||
if let padding = dictionary.optionalCGFloatForKey("buttonHeadlinePadding") {
|
||||
buttonHeadlinePadding = padding
|
||||
}
|
||||
|
||||
headlineBody.setWithJSON(dictionary.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
|
||||
if let buttonDictionary = dictionary.optionalDictionaryForKey("button") {
|
||||
button.setWithJSON(buttonDictionary, delegateObject: delegateObject, additionalData: additionalData)
|
||||
} else {
|
||||
button.isHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
90
MVMCoreUI/Molecules/RadioButtonLabel.swift
Normal file
90
MVMCoreUI/Molecules/RadioButtonLabel.swift
Normal file
@ -0,0 +1,90 @@
|
||||
//
|
||||
// RadioButtonWithLabel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Suresh, Kamlesh on 10/21/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class RadioButtonLabel: ViewConstrainingView {
|
||||
|
||||
public let radioButton = RadioButton()
|
||||
var delegateObject: MVMCoreUIDelegateObject?
|
||||
let label = Label()
|
||||
|
||||
// MARK: - Inits
|
||||
public init() {
|
||||
super.init(frame: .zero)
|
||||
}
|
||||
|
||||
public override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
public override func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
radioButton.updateView(size)
|
||||
label.updateView(size)
|
||||
}
|
||||
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
guard subviews.count == 0 else {
|
||||
return
|
||||
}
|
||||
|
||||
addSubview(radioButton)
|
||||
radioButton.leftAnchor.constraint(equalTo: layoutMarginsGuide.leftAnchor, constant: 0).isActive = true
|
||||
radioButton.topAnchor.constraint(greaterThanOrEqualTo: layoutMarginsGuide.topAnchor, constant: PaddingOne).isActive = true
|
||||
layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: radioButton.bottomAnchor, constant: PaddingOne).isActive = true
|
||||
radioButton.centerYAnchor.constraint(equalTo: layoutMarginsGuide.centerYAnchor).isActive = true
|
||||
|
||||
if let rightView = createRightView() {
|
||||
addSubview(rightView)
|
||||
rightView.leftAnchor.constraint(equalTo: radioButton.rightAnchor, constant: PaddingHorizontalBetweenRelatedItems).isActive = true
|
||||
rightView.rightAnchor.constraint(equalTo: layoutMarginsGuide.rightAnchor, constant: 0).isActive = true
|
||||
|
||||
var constraint = rightView.topAnchor.constraint(greaterThanOrEqualTo: layoutMarginsGuide.topAnchor, constant: PaddingOne)
|
||||
constraint.priority = .defaultHigh
|
||||
constraint.isActive = true
|
||||
|
||||
constraint = layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: rightView.bottomAnchor, constant: PaddingOne)
|
||||
constraint.priority = .defaultHigh
|
||||
constraint.isActive = true
|
||||
layoutMarginsGuide.centerYAnchor.constraint(equalTo: rightView.centerYAnchor).isActive = true
|
||||
}
|
||||
}
|
||||
|
||||
func createRightView() -> ViewConstrainingView? {
|
||||
let rightView = ViewConstrainingView(constrainingView: label)
|
||||
return rightView
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
extension RadioButtonLabel {
|
||||
@objc open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||
self.delegateObject = delegateObject
|
||||
radioButton.setWithJSON(json?.optionalDictionaryForKey("radioButton"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
label.setWithJSON(json?.optionalDictionaryForKey(KeyLabel),
|
||||
delegateObject: delegateObject,
|
||||
additionalData: additionalData)
|
||||
}
|
||||
|
||||
public override func reset() {
|
||||
super.reset()
|
||||
radioButton.reset()
|
||||
label.reset()
|
||||
}
|
||||
|
||||
public override class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
return 45
|
||||
}
|
||||
}
|
||||
54
MVMCoreUI/Molecules/RadioButtonModel.swift
Normal file
54
MVMCoreUI/Molecules/RadioButtonModel.swift
Normal file
@ -0,0 +1,54 @@
|
||||
//
|
||||
// RadioButtonModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Suresh, Kamlesh on 5/14/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class RadioButtonModel: NSObject {
|
||||
|
||||
private var selectedRadioButton: RadioButton?
|
||||
private var fieldGroupName: String?
|
||||
|
||||
public static func setupForRadioButtonGroup(radioButton: RadioButton, formValidator: FormValidator?) -> RadioButtonModel {
|
||||
guard let groupName = radioButton.radioGroupName,
|
||||
let formValidator = formValidator else {
|
||||
return RadioButtonModel()
|
||||
}
|
||||
|
||||
let radioButtonModel = formValidator.radioButtonsModelByGroup[groupName] ?? RadioButtonModel()
|
||||
radioButtonModel.fieldGroupName = radioButton.formFieldGroupName()
|
||||
formValidator.radioButtonsModelByGroup[groupName] = radioButtonModel
|
||||
return radioButtonModel
|
||||
}
|
||||
|
||||
public func selected(_ radioButton: RadioButton) {
|
||||
selectedRadioButton?.isSelected = false
|
||||
selectedRadioButton = radioButton
|
||||
selectedRadioButton?.isSelected = true
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - FormValidationProtocol
|
||||
extension RadioButtonModel: FormValidationFormFieldProtocol {
|
||||
public func formFieldGroupName() -> String? {
|
||||
return selectedRadioButton?.formFieldGroupName() ?? self.fieldGroupName
|
||||
}
|
||||
|
||||
// Used to check the validity of the field, to enable/disable the primary button.
|
||||
@objc public func isValidField() -> Bool {
|
||||
return selectedRadioButton != nil ? true : false
|
||||
}
|
||||
// Name of the field to send to server
|
||||
@objc public func formFieldName() -> String? {
|
||||
return selectedRadioButton?.fieldKey
|
||||
}
|
||||
// The field value key value pair for sending to server
|
||||
@objc public func formFieldValue() -> Any? {
|
||||
return selectedRadioButton != nil ? true : false
|
||||
}
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class MoleculeStackView: ViewConstrainingView {
|
||||
return "stack<>"
|
||||
}
|
||||
var name = "stack<"
|
||||
for case let item as [AnyHashable: AnyHashable] in molecules {
|
||||
for case let item as [AnyHashable: Any] in molecules {
|
||||
if let molecule = item.optionalDictionaryForKey(KeyMolecule), let moleculeName = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(withJSON: molecule)?.name?(forReuse: molecule, delegateObject: delegateObject) ?? molecule.optionalStringForKey(KeyMoleculeName) {
|
||||
name.append(moleculeName + ",")
|
||||
}
|
||||
|
||||
@ -43,6 +43,9 @@
|
||||
@"cornerLabels" : CornerLabels.class,
|
||||
@"progressBar": ProgressBar.class,
|
||||
@"multiProgressBar": MultiProgress.class,
|
||||
@"checkbox": MVMCoreUICheckBox.class,
|
||||
@"radioButton": RadioButton.class,
|
||||
@"radioButtonLabel": RadioButtonLabel.class,
|
||||
@"listItem": MoleculeTableViewCell.class,
|
||||
@"accordionListItem": AccordionMoleculeTableViewCell.class,
|
||||
@"switch": MVMCoreUISwitch.class,
|
||||
@ -61,6 +64,7 @@
|
||||
@"headlineBodyTextButton": HeadlineBodyTextButton.class,
|
||||
@"headlineBodyTextButtonSwitch": HeadlineBodyTextButtonSwitch.class,
|
||||
@"tabsListItem": TabsTableViewCell.class,
|
||||
@"headlineBodyButton": HeadlineBodyButton.class,
|
||||
@"eyebrowHeadlineBodyLink": EyebrowHeadlineBodyLink.class
|
||||
} mutableCopy];
|
||||
});
|
||||
|
||||
@ -36,6 +36,7 @@ extern CGFloat const PaddingHorizontalLarge;
|
||||
extern CGFloat const PaddingVerticalWhiteGrayView;
|
||||
extern CGFloat const PaddingVerticalHeadlineAlternate;
|
||||
extern CGFloat const PaddingPrimaryButtonTop;
|
||||
extern CGFloat const PaddingHorizontalBetweenRelatedItems;
|
||||
|
||||
// These are based on the multiple of 6 rule
|
||||
extern CGFloat const PaddingOne;
|
||||
|
||||
@ -26,6 +26,7 @@ CGFloat const PaddingVerticalWhiteGrayView = 72;
|
||||
CGFloat const PaddingVerticalHeadlineAlternate = 48;
|
||||
CGFloat const PaddingPrimaryButtonTop = 36;
|
||||
|
||||
CGFloat const PaddingHorizontalBetweenRelatedItems = 16;
|
||||
CGFloat const PaddingOne = 6;
|
||||
CGFloat const PaddingTwo = 12;
|
||||
CGFloat const PaddingThree = 18;
|
||||
|
||||
@ -36,6 +36,13 @@
|
||||
"checkbox_checked_state" = "Checked";
|
||||
"checkbox_unchecked_state" = "Unchecked";
|
||||
"checkbox_desc_state" = "%@ CheckBox %@";
|
||||
|
||||
// Radio Button
|
||||
"radio_action_hint" = "Double tap to select";
|
||||
"radio_selected_state" = "Selected";
|
||||
"radio_not_selected_state" = "Not Selected";
|
||||
"radio_desc_state" = "Option";
|
||||
|
||||
// Switch
|
||||
"mfswitch_buttonlabel" = "Switch Button";
|
||||
"AccOn" = "on";
|
||||
|
||||
@ -37,6 +37,11 @@
|
||||
"checkbox_checked_state" = "Verificado";
|
||||
"checkbox_unchecked_state" = "Sin marcar";
|
||||
"checkbox_desc_state" = "%@ Casilla %@";
|
||||
// Radio Button
|
||||
"radio_action_hint" = "Toca dos veces para seleccionar.";
|
||||
"radio_selected_state" = "Seleccionado";
|
||||
"radio_not_selected_state" = "No Seleccionado";
|
||||
"radio_desc_state" = "Opción";
|
||||
// Switch
|
||||
"mfswitch_buttonlabel" = "Botón Cambiar";
|
||||
"AccOn" = "encendido";
|
||||
|
||||
@ -37,6 +37,13 @@
|
||||
"checkbox_checked_state" = "Verificado";
|
||||
"checkbox_unchecked_state" = "Sin marcar";
|
||||
"checkbox_desc_state" = "%@ Casilla %@";
|
||||
|
||||
// Radio Button
|
||||
"radio_action_hint" = "Toca dos veces para seleccionar.";
|
||||
"radio_selected_state" = "Seleccionado";
|
||||
"radio_not_selected_state" = "No Seleccionado";
|
||||
"radio_desc_state" = "Opción";
|
||||
|
||||
// Switch
|
||||
"mfswitch_buttonlabel" = "Botón Cambiar";
|
||||
"AccOn" = "encendido";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user