From 1d1bcf1b4a90b1025c3e2dc0b2dbcae1a448291f Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Mon, 2 Mar 2020 11:43:50 +0530 Subject: [PATCH 01/43] 19084 - List Right variable Total Data --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ .../ListRightVariableTotalData.swift | 69 +++++++++++++++++++ .../ListRightVariableTotalDataModel.swift | 49 +++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 127 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 339735f3..2f2bf8a7 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -110,6 +110,8 @@ 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */; }; 52B201D224081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */; }; 52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */; }; + 8D084A7F240CD9E500951227 /* ListRightVariableTotalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084A7E240CD9E500951227 /* ListRightVariableTotalData.swift */; }; + 8D084A81240CDB5800951227 /* ListRightVariableTotalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084A80240CDB5800951227 /* ListRightVariableTotalDataModel.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; 8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */; }; 8D448E5524050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */; }; @@ -456,6 +458,8 @@ 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDivider.swift; sourceTree = ""; }; 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethod.swift; sourceTree = ""; }; 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethodModel.swift; sourceTree = ""; }; + 8D084A7E240CD9E500951227 /* ListRightVariableTotalData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalData.swift; sourceTree = ""; }; + 8D084A80240CDB5800951227 /* ListRightVariableTotalDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataModel.swift; sourceTree = ""; }; 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = ""; }; 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretModel.swift; sourceTree = ""; }; 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinksModel.swift; sourceTree = ""; }; @@ -861,8 +865,10 @@ children = ( AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */, AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */, + 8D084A80240CDB5800951227 /* ListRightVariableTotalDataModel.swift */, C7F8012223E846C300396FBD /* ListRVWheelModel.swift */, C7F8012023E8303200396FBD /* ListRVWheel.swift */, + 8D084A7E240CD9E500951227 /* ListRightVariableTotalData.swift */, ); path = RightVariable; sourceTree = ""; @@ -1765,6 +1771,7 @@ D2A5145F2211DDC100345BFB /* MoleculeStackView.swift in Sources */, C7F8012323E846C300396FBD /* ListRVWheelModel.swift in Sources */, D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, + 8D084A7F240CD9E500951227 /* ListRightVariableTotalData.swift in Sources */, C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */, 014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */, D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */, @@ -1810,6 +1817,7 @@ 0A7EF85B23D8A52800B2AAD1 /* EntryFieldModel.swift in Sources */, 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */, 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */, + 8D084A81240CDB5800951227 /* ListRightVariableTotalDataModel.swift in Sources */, 0A21DB8B235E06EF00C160A2 /* MFDigitTextBox.m in Sources */, D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */, D2B18B812360945C00A9AEDC /* View.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift new file mode 100644 index 00000000..78ee9448 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift @@ -0,0 +1,69 @@ +// +// ListRightVariableTotalData.swift +// MVMCoreUI +// +// Created by Kruthika KP on 02/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ListRightVariableTotalData: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + var stack: Stack + let leftLabel = Label.commonLabelB1(true) + let rightLabel = Label.commonLabelB2(true) + let bar = Line() + + //----------------------------------------------------- + // MARK: - Initializers + //----------------------------------------------------- + + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)), + (view: bar, model: StackItemModel(horizontalAlignment: .trailing)), + (view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))], + axis: .horizontal) + bar.widthAnchor.constraint(equalToConstant: 20).isActive = true + + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //----------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + + override open func setupView() { + super.setupView() + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(901), for: .horizontal) + addMolecule(stack) + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListRightVariableTotalDataModel else { return} + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + bar.set(with: model.bar, delegateObject, additionalData) + stack.restack() + } + + open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{ + return 90 + } + + open override func reset() { + super.reset() + leftLabel.styleB1(true) + rightLabel.styleB2(true) + bar.setStyle(.heavy) + } +} + diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift new file mode 100644 index 00000000..ec6299e0 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift @@ -0,0 +1,49 @@ +// +// ListRightVariableTotalDataModel.swift +// MVMCoreUI +// +// Created by Kruthika KP on 02/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol { + + public static var identifier: String = "listRVLine" + public var leftLabel: LabelModel + public var rightLabel: LabelModel + public var bar : LineModel + + public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){ + self.leftLabel = leftLabel + self.rightLabel = rightlabel + self.bar = bar + super.init() + } + + private enum CodingKeys: String, CodingKey{ + case moleculeName + case leftLabel + case rightLabel + case bar + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) + rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) + bar = try typeContainer.decode(LineModel.self, forKey: .bar) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(leftLabel, forKey: .leftLabel) + try container.encode(rightLabel, forKey: .rightLabel) + try container.encode(bar, forKey: .bar) + + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 34da2080..ccda2ddd 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -78,6 +78,7 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DropDownFilterTableViewCell.self, viewModelClass: DropDownListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: AccordionMoleculeTableViewCell.self, viewModelClass: AccordionListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TabsTableViewCell.self, viewModelClass: TabsListItemModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRightVariableTotalData.self, viewModelClass: ListRightVariableTotalDataModel.self) // Other Items MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackItem.self, viewModelClass: MoleculeStackItemModel.self) From 9090a30c851bc9a06b76d0513a0d753d2e1be78e Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 5 Mar 2020 12:23:48 +0530 Subject: [PATCH 02/43] Headers - H2 - No Buttons - Body Text story initial commit --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ .../HeadersH2NoButtonsBodyText.swift | 44 ++++++++++++++++ .../HeadersH2NoButtonsBodyTextModel.swift | 51 +++++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 3 ++ 4 files changed, 106 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyText.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyTextModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 339735f3..55f0d54a 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -149,6 +149,8 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; + AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; + AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -494,6 +496,8 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; + AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; + AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -1041,6 +1045,8 @@ children = ( D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, + AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, ); path = DesignedComponents; sourceTree = ""; @@ -1786,6 +1792,7 @@ AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */, 01EB369223609801006832FA /* MoleculeStackModel.swift in Sources */, 012CA99E2385A2D3003F810F /* MFView+ModelExtension.swift in Sources */, + AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */, D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */, 944589232385DA9600DE9FD4 /* ImageViewModel.swift in Sources */, D213347723843825008E41B3 /* Line.swift in Sources */, @@ -1873,6 +1880,7 @@ D2FB151B23A2B65B00C20E10 /* MoleculeContainer.swift in Sources */, D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */, D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */, + AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */, 522679C223FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyText.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyText.swift new file mode 100644 index 00000000..4443c137 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyText.swift @@ -0,0 +1,44 @@ +// +// HeadersH2NoButtonsBodyText.swift +// MVMCoreUI +// +// Created by Lekshmi S on 05/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH2NoButtonsBodyText: View { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + let headlineBody = HeadlineBody(frame: .zero) + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + headlineBody.stylePageHeader() + addSubview(headlineBody) + NSLayoutConstraint.constraintPinSubview(toSuperview: headlineBody) + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? HeadersH2NoButtonsBodyTextModel else { return } + headlineBody.set(with: model.headlineBody, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headlineBody.stylePageHeader() + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyTextModel.swift new file mode 100644 index 00000000..59e244ca --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyTextModel.swift @@ -0,0 +1,51 @@ +// +// HeadersH2NoButtonsBodyTextModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 05/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "headerH2" + public var backgroundColor: Color? + public var headlineBody: HeadlineBodyModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headlineBody: HeadlineBodyModel) { + self.headlineBody = headlineBody + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case headlineBody + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) + headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(headlineBody, forKey: .headlineBody) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 34da2080..1940ef49 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -107,6 +107,9 @@ import Foundation // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) + + // Designed Headers + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) // TODO: Need model MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString) From 23fe4cbe3d6c00b46b4f42dfc90b6a8a9c80cc70 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Thu, 5 Mar 2020 20:24:01 +0530 Subject: [PATCH 03/43] Created folder for designed headers. --- MVMCoreUI.xcodeproj/project.pbxproj | 30 ++++++++++++------- .../HeadersH2NoButtonsBodyText.swift | 0 .../HeadersH2NoButtonsBodyTextModel.swift | 0 3 files changed, 19 insertions(+), 11 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH2NoButtonsBodyText.swift (100%) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH2NoButtonsBodyTextModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f5203935..d678b378 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -815,6 +815,15 @@ path = Link; sourceTree = ""; }; + 5206F150241144A900658DC5 /* Headers */ = { + isa = PBXGroup; + children = ( + AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, + AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + ); + path = Headers; + sourceTree = ""; + }; 52267A0523FFE0A900906CBA /* OneColumn */ = { isa = PBXGroup; children = ( @@ -824,15 +833,6 @@ path = OneColumn; sourceTree = ""; }; - 525239C32407FFCC00454969 /* LockUps */ = { - isa = PBXGroup; - children = ( - 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */, - 525019DC2406430800EED91C /* ListProgressBarData.swift */, - ); - path = LockUps; - sourceTree = ""; - }; 525019E3240684E500EED91C /* FourColumn */ = { isa = PBXGroup; children = ( @@ -842,6 +842,15 @@ path = FourColumn; sourceTree = ""; }; + 525239C32407FFCC00454969 /* LockUps */ = { + isa = PBXGroup; + children = ( + 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */, + 525019DC2406430800EED91C /* ListProgressBarData.swift */, + ); + path = LockUps; + sourceTree = ""; + }; 946EE1B5237B663A0036751F /* Extensions */ = { isa = PBXGroup; children = ( @@ -1056,11 +1065,10 @@ D22B38E923F4E07800490EF6 /* DesignedComponents */ = { isa = PBXGroup; children = ( + 5206F150241144A900658DC5 /* Headers */, 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, - AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, ); path = DesignedComponents; sourceTree = ""; diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyText.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift similarity index 100% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyText.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift similarity index 100% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH2NoButtonsBodyTextModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift From b5bbce6294ed1a0dd8e97dfb10ad82d5a4d98b93 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Mon, 9 Mar 2020 11:31:46 +0530 Subject: [PATCH 04/43] List - One Column - Text With Whitespace - Divider - Tall Molecule implemented --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ ...eColumnTextWithWhitespaceDividerTall.swift | 59 +++++++++++++++++++ ...mnTextWithWhitespaceDividerTallModel.swift | 48 +++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 116 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 8de69762..00d8106f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -154,6 +154,8 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; + BB47A58224161003002BB23C /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A58124161003002BB23C /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */; }; + BB47A5842416101D002BB23C /* ListOneColumnTextWithWhitespaceDividerTall.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A5832416101D002BB23C /* ListOneColumnTextWithWhitespaceDividerTall.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -505,6 +507,8 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; + BB47A58124161003002BB23C /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnTextWithWhitespaceDividerTallModel.swift; sourceTree = ""; }; + BB47A5832416101D002BB23C /* ListOneColumnTextWithWhitespaceDividerTall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnTextWithWhitespaceDividerTall.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -821,6 +825,8 @@ 52267A0523FFE0A900906CBA /* OneColumn */ = { isa = PBXGroup; children = ( + BB47A58124161003002BB23C /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */, + BB47A5832416101D002BB23C /* ListOneColumnTextWithWhitespaceDividerTall.swift */, 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */, 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */, ); @@ -1764,6 +1770,7 @@ 9445890C2385BCE300DE9FD4 /* ProgressBarModel.swift in Sources */, 9445891F2385D2E900DE9FD4 /* CaretViewModel.swift in Sources */, 01C851D323CF9E740021F976 /* LabelToggleModel.swift in Sources */, + BB47A58224161003002BB23C /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */, D29DF2C521E7BF57003B2FB9 /* MFTabBarSwipeAnimator.m in Sources */, D2E2A98323D8B32D000B42E6 /* EyebrowHeadlineBodyLinkModel.swift in Sources */, 012A88AD238C418100FE3DA1 /* TemplateProtocol.swift in Sources */, @@ -1824,6 +1831,7 @@ D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */, 0A7EF85F23D8ABC500B2AAD1 /* MdnEntryFieldModel.swift in Sources */, 01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */, + BB47A5842416101D002BB23C /* ListOneColumnTextWithWhitespaceDividerTall.swift in Sources */, 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */, D260105523CEA7DC00764D80 /* MVMCoreUISwitch+Model.swift in Sources */, D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift new file mode 100644 index 00000000..f264bc44 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -0,0 +1,59 @@ +// +// ListOneColumnTextWithWhitespaceDividerTall.swift +// MVMCoreUI +// +// Created by Dhamodaram Nandi on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +@objcMembers public class ListOneColumnTextWithWhitespaceDividerTall: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + var stack: Stack + let headline = Label.commonLabelH3(true) + let body = Label.commonLabelB2(true) + + + // MARK: - Initializers + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),(view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))],axis: .vertical) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //----------------------------------------------------- + // MARK: - View Lifecycle + //----------------------------------------------------- + override open func setupView() { + super.setupView() + addMolecule(stack) + stack.restack() + + + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListOneColumnTextWithWhitespaceDividerTallModel else { return } + headline.setOptional(with: model.headline, delegateObject, additionalData) + body.setOptional(with: model.body, delegateObject, additionalData) + + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } + + open override func reset() { + super.reset() + headline.styleH3(true) + body.styleB2(true) + + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift new file mode 100644 index 00000000..f93f601b --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift @@ -0,0 +1,48 @@ +// +// ListOneColumnTextWithWhitespaceDividerTallModel.swift +// MVMCoreUI +// +// Created by Dhamodaram Nandi on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel,MoleculeModelProtocol{ + public static var identifier: String = "list1CTxtDiv2" + public var headline: LabelModel + public var body: LabelModel + + public init(headline: LabelModel, body: LabelModel) { + self.headline = headline + self.body = body + super.init() + } + + /// Defaults to set + override public func setDefaults() { + super.setDefaults() + style = "tallDivider" + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case headline + case body + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headline, forKey: .headline) + try container.encode(body, forKey: .body) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 003b5d03..45ff06c0 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -105,6 +105,7 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListLeftVariableRadioButtonAndPaymentMethod.self, viewModelClass: ListLeftVariableRadioButtonAndPaymentMethodModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerTall.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerTallModel.self) // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) From 219a667c1ab41c2b0d9d0d4b0af35b2eff6dc1f3 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Mon, 9 Mar 2020 12:45:30 +0530 Subject: [PATCH 05/43] ListOneColumnFullWidthTextDividerSubsection Molecule implemented. --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ ...ColumnFullWidthTextDividerSubsection.swift | 59 +++++++++++++++++++ ...nFullWidthTextDividerSubsectionModel.swift | 48 +++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 116 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 8de69762..875eeb73 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -154,6 +154,8 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -505,6 +507,8 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -821,6 +825,8 @@ 52267A0523FFE0A900906CBA /* OneColumn */ = { isa = PBXGroup; children = ( + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */, + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */, 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */, 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */, ); @@ -1754,6 +1760,7 @@ 0AA33B3A2398524F0067DD0F /* Toggle.swift in Sources */, D29DF12F21E6851E003B2FB9 /* MVMCoreUITopAlertMainView.m in Sources */, 942C378C2412F4FA0066E45E /* ModalMoleculeListTemplate.swift in Sources */, + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */, 012A88C8238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift in Sources */, 0A7EF86123D8AC2500B2AAD1 /* DigitEntryFieldModel.swift in Sources */, DBC4392122491730001AB423 /* LabelWithInternalButton.swift in Sources */, @@ -1834,6 +1841,7 @@ 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */, 0A21DB8B235E06EF00C160A2 /* MFDigitTextBox.m in Sources */, D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */, + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */, D2B18B812360945C00A9AEDC /* View.swift in Sources */, C6FA7D5423C77A4A00A3614A /* NumberedList.swift in Sources */, D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift new file mode 100644 index 00000000..206935ab --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift @@ -0,0 +1,59 @@ +// +// ListOneColumnFullWidthTextDividerSubsection.swift +// MVMCoreUI +// +// Created by Dhamodaram Nandi on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +@objcMembers public class ListOneColumnFullWidthTextDividerSubsection: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + var stack: Stack + let headline = Label.commonLabelB1(true) + let body = Label.commonLabelB2(true) + + + // MARK: - Initializers + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),(view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))],axis: .vertical) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //----------------------------------------------------- + // MARK: - View Lifecycle + //----------------------------------------------------- + override open func setupView() { + super.setupView() + addMolecule(stack) + stack.restack() + + + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListOneColumnFullWidthTextDividerSubsectionModel else { return } + headline.setOptional(with: model.headline, delegateObject, additionalData) + body.setOptional(with: model.body, delegateObject, additionalData) + + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } + + open override func reset() { + super.reset() + headline.styleB1(true) + body.styleB2(true) + + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift new file mode 100644 index 00000000..bb39cf9e --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift @@ -0,0 +1,48 @@ +// +// ListOneColumnFullWidthTextDividerSubsectionModel.swift +// MVMCoreUI +// +// Created by Dhamodaram Nandi on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListOneColumnFullWidthTextDividerSubsectionModel: ListItemModel,MoleculeModelProtocol{ + public static var identifier: String = "list1CTxtDiv3" + public var headline: LabelModel + public var body: LabelModel + + public init(headline: LabelModel, body: LabelModel) { + self.headline = headline + self.body = body + super.init() + } + + /// Defaults to set + override public func setDefaults() { + super.setDefaults() + style = "tallDivider" + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case headline + case body + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headline, forKey: .headline) + try container.encode(body, forKey: .body) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 003b5d03..2e1ae5fb 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -105,6 +105,7 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListLeftVariableRadioButtonAndPaymentMethod.self, viewModelClass: ListLeftVariableRadioButtonAndPaymentMethodModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) From ffbbe5df35e900c6543473ce2d915c72b30977d4 Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Fri, 13 Mar 2020 11:29:58 +0530 Subject: [PATCH 06/43] Added view and model classes --- MVMCoreUI.xcodeproj/project.pbxproj | 18 +++-- .../ListRightVariableTotalDataCaret.swift | 68 +++++++++++++++++++ ...ListRightVariableTotalDataCaretModel.swift | 49 +++++++++++++ 3 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index fe6c32b8..21218b89 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -112,10 +112,12 @@ 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */; }; 52B201D224081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */; }; 52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */; }; + 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */; }; + 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */; }; + 8D084A7F240CD9E500951227 /* (null) in Sources */ = {isa = PBXBuildFile; }; + 8D084A81240CDB5800951227 /* (null) in Sources */ = {isa = PBXBuildFile; }; 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */; }; 8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */; }; - 8D084A7F240CD9E500951227 /* ListRightVariableTotalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084A7E240CD9E500951227 /* ListRightVariableTotalData.swift */; }; - 8D084A81240CDB5800951227 /* ListRightVariableTotalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084A80240CDB5800951227 /* ListRightVariableTotalDataModel.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; 8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */; }; 8D448E5524050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */; }; @@ -468,6 +470,8 @@ 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDivider.swift; sourceTree = ""; }; 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethod.swift; sourceTree = ""; }; 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethodModel.swift; sourceTree = ""; }; + 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataCaretModel.swift; sourceTree = ""; }; + 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataCaret.swift; sourceTree = ""; }; 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyTextModel.swift; sourceTree = ""; }; 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyText.swift; sourceTree = ""; }; 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = ""; }; @@ -881,10 +885,10 @@ children = ( AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */, AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */, - 8D084A80240CDB5800951227 /* ListRightVariableTotalDataModel.swift */, + 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */, + 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */, C7F8012223E846C300396FBD /* ListRVWheelModel.swift */, C7F8012023E8303200396FBD /* ListRVWheel.swift */, - 8D084A7E240CD9E500951227 /* ListRightVariableTotalData.swift */, ); path = RightVariable; sourceTree = ""; @@ -1732,6 +1736,7 @@ files = ( 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */, 0A5D59C223AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift in Sources */, + 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift in Sources */, 943784F5236B77BB006A1E82 /* GraphView.swift in Sources */, 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */, 94C661DA23CCF4FB00D9FE5B /* UIColor+Extension.swift in Sources */, @@ -1796,7 +1801,7 @@ D2A5145F2211DDC100345BFB /* MoleculeStackView.swift in Sources */, C7F8012323E846C300396FBD /* ListRVWheelModel.swift in Sources */, D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, - 8D084A7F240CD9E500951227 /* ListRightVariableTotalData.swift in Sources */, + 8D084A7F240CD9E500951227 /* (null) in Sources */, C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */, 014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */, D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */, @@ -1844,7 +1849,7 @@ 0A7EF85B23D8A52800B2AAD1 /* EntryFieldModel.swift in Sources */, 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */, 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */, - 8D084A81240CDB5800951227 /* ListRightVariableTotalDataModel.swift in Sources */, + 8D084A81240CDB5800951227 /* (null) in Sources */, 0A21DB8B235E06EF00C160A2 /* MFDigitTextBox.m in Sources */, D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */, D2B18B812360945C00A9AEDC /* View.swift in Sources */, @@ -1934,6 +1939,7 @@ 012CA99A2384A687003F810F /* MFTextField+ModelExtension.swift in Sources */, 01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */, D27CD4102339057800C1DC07 /* EyebrowHeadlineBodyLink.swift in Sources */, + 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift in Sources */, D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */, 0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */, D243859923A16B1800332775 /* Container.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift new file mode 100644 index 00000000..1cbffb7b --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift @@ -0,0 +1,68 @@ +// +// ListRightVariableTotalData.swift +// MVMCoreUI +// +// Created by Kruthika KP on 02/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ListRightVariableTotalData: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + var stack: Stack + let leftLabel = Label.commonLabelB1(true) + let rightLabel = Label.commonLabelB2(true) + let bar = Line() + + //----------------------------------------------------- + // MARK: - Initializers + //----------------------------------------------------- + + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)), + (view: bar, model: StackItemModel(horizontalAlignment: .trailing)), + (view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))], + axis: .horizontal) + bar.widthAnchor.constraint(equalToConstant: 20).isActive = true + + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //----------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + + override open func setupView() { + super.setupView() + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(901), for: .horizontal) + addMolecule(stack) + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListRightVariableTotalDataModel else { return} + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + bar.set(with: model.bar, delegateObject, additionalData) + stack.restack() + } + + open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{ + return 90 + } + + open override func reset() { + super.reset() + leftLabel.styleB1(true) + rightLabel.styleB2(true) + bar.setStyle(.heavy) + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift new file mode 100644 index 00000000..ec6299e0 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift @@ -0,0 +1,49 @@ +// +// ListRightVariableTotalDataModel.swift +// MVMCoreUI +// +// Created by Kruthika KP on 02/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol { + + public static var identifier: String = "listRVLine" + public var leftLabel: LabelModel + public var rightLabel: LabelModel + public var bar : LineModel + + public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){ + self.leftLabel = leftLabel + self.rightLabel = rightlabel + self.bar = bar + super.init() + } + + private enum CodingKeys: String, CodingKey{ + case moleculeName + case leftLabel + case rightLabel + case bar + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) + rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) + bar = try typeContainer.decode(LineModel.self, forKey: .bar) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(leftLabel, forKey: .leftLabel) + try container.encode(rightLabel, forKey: .rightLabel) + try container.encode(bar, forKey: .bar) + + } +} From 1f79a5e933bc2809b5e7080ae6678a29fa973295 Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Fri, 13 Mar 2020 12:09:47 +0530 Subject: [PATCH 07/43] Added hero property to right label --- .../ListRightVariableTotalDataCaretModel.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift index ec6299e0..c5912a37 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift @@ -15,11 +15,17 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc public var rightLabel: LabelModel public var bar : LineModel + override public func setDefaults() { + super.setDefaults() + rightLabel.hero = 0 + } + public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){ self.leftLabel = leftLabel self.rightLabel = rightlabel self.bar = bar super.init() + setDefaults() } private enum CodingKeys: String, CodingKey{ From 1b3766e2b79463d405266849c479f85b7a769102 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Fri, 13 Mar 2020 13:57:38 +0530 Subject: [PATCH 08/43] code refactoring --- ...istOneColumnTextWithWhitespaceDividerTall.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index f264bc44..fdc660fb 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -7,7 +7,7 @@ // import Foundation -@objcMembers public class ListOneColumnTextWithWhitespaceDividerTall: TableViewCell { +@objcMembers open class ListOneColumnTextWithWhitespaceDividerTall: TableViewCell { //----------------------------------------------------- // MARK: - Outlets @@ -16,10 +16,11 @@ import Foundation let headline = Label.commonLabelH3(true) let body = Label.commonLabelB2(true) - // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),(view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))],axis: .vertical) + stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), + (view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))], + axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -34,16 +35,13 @@ import Foundation super.setupView() addMolecule(stack) stack.restack() - - } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ super.set(with: model, delegateObject, additionalData) guard let model = model as? ListOneColumnTextWithWhitespaceDividerTallModel else { return } - headline.setOptional(with: model.headline, delegateObject, additionalData) - body.setOptional(with: model.body, delegateObject, additionalData) - + headline.set(with: model.headline, delegateObject, additionalData) + body.set(with: model.body, delegateObject, additionalData) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { From 7fd0eb65f74003bd1a95cb956918dd5eef681a7e Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 13 Mar 2020 13:39:08 -0400 Subject: [PATCH 09/43] change func signature for better readability --- MVMCoreUI/Categories/UIColor+Extension.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 94bf780d..9abedf97 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -289,7 +289,7 @@ extension UIColor { return .white } - public class func setBackgroundColor(forNavigationBar color: UIColor, navigationBar: UINavigationBar, transparent: Bool) { + public class func setBackgroundColor(_ color: UIColor, for navigationBar: UINavigationBar, isTransparent: Bool) { DispatchQueue.main.async { @@ -305,7 +305,7 @@ extension UIColor { let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() - if transparent { + if isTransparent { navigationBar.setBackgroundImage(UIImage(), for: .default) navigationBar.isTranslucent = false } else { From c65d7d233e8b7530a798f4082964c8526462d5a5 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Mon, 16 Mar 2020 23:06:31 -0400 Subject: [PATCH 10/43] validate_on_appear --- MVMCoreUI/BaseControllers/MFViewController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index fef3b860..7266c54f 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -484,7 +484,6 @@ - (void)newDataBuildAndUpdate { [MVMCoreDispatchUtility performBlockOnMainThread:^{ [self newDataBuildScreen]; - [self startValidation]; self.needToUpdateUI = YES; [self.view setNeedsLayout]; }]; @@ -536,6 +535,8 @@ if (!self.disableAnimations) { [self.introAnimationManager performAnimations]; } + + [self startValidation]; } - (void)viewWillDisappear:(BOOL)animated { From 9583ba9c5db66ae1d93700f8a2a259ff590ee086 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 17 Mar 2020 11:51:53 +0530 Subject: [PATCH 11/43] code refactoring --- .../ListOneColumnFullWidthTextDividerSubsection.swift | 11 +++-------- MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift | 2 ++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift index 206935ab..543f1158 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift @@ -7,7 +7,7 @@ // import Foundation -@objcMembers public class ListOneColumnFullWidthTextDividerSubsection: TableViewCell { +@objcMembers open class ListOneColumnFullWidthTextDividerSubsection: TableViewCell { //----------------------------------------------------- // MARK: - Outlets @@ -16,7 +16,6 @@ import Foundation let headline = Label.commonLabelB1(true) let body = Label.commonLabelB2(true) - // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),(view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))],axis: .vertical) @@ -34,16 +33,13 @@ import Foundation super.setupView() addMolecule(stack) stack.restack() - - } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ super.set(with: model, delegateObject, additionalData) guard let model = model as? ListOneColumnFullWidthTextDividerSubsectionModel else { return } - headline.setOptional(with: model.headline, delegateObject, additionalData) - body.setOptional(with: model.body, delegateObject, additionalData) - + headline.set(with: model.headline, delegateObject, additionalData) + body.set(with: model.body, delegateObject, additionalData) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { @@ -54,6 +50,5 @@ import Foundation super.reset() headline.styleB1(true) body.styleB2(true) - } } diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index cc3950cd..7f3c8b9e 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -107,6 +107,8 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextBodyText.self, viewModelClass: ListOneColumnFullWidthTextBodyTextModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) + // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) From 50ef2ff6cced48e09041937311490ada1ff5082d Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Tue, 17 Mar 2020 16:04:59 +0530 Subject: [PATCH 12/43] Line style changes --- .../RightVariable/ListRightVariableTotalDataCaret.swift | 6 +++--- .../ListRightVariableTotalDataCaretModel.swift | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift index 1cbffb7b..0be49a32 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift @@ -28,7 +28,6 @@ import Foundation (view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))], axis: .horizontal) bar.widthAnchor.constraint(equalToConstant: 20).isActive = true - super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -42,7 +41,8 @@ import Foundation override open func setupView() { super.setupView() - rightLabel.setContentCompressionResistancePriority(UILayoutPriority(901), for: .horizontal) + rightLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) + bar.setStyle(.heavy) addMolecule(stack) } @@ -56,7 +56,7 @@ import Foundation } open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{ - return 90 + return 80 } open override func reset() { diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift index c5912a37..6d1ba0c5 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift @@ -18,6 +18,10 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc override public func setDefaults() { super.setDefaults() rightLabel.hero = 0 + bar.type = .heavy + if bar.backgroundColor == nil { + bar.backgroundColor = Color(uiColor: .mvmBlue) + } } public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){ @@ -25,7 +29,6 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc self.rightLabel = rightlabel self.bar = bar super.init() - setDefaults() } private enum CodingKeys: String, CodingKey{ @@ -35,6 +38,7 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc case bar } + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) From 31a11aa03e32886579172f0532c4b5f80f004417 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 17 Mar 2020 16:11:01 +0530 Subject: [PATCH 13/43] Conforming to HeaderView and HeaderModel as per review comments. --- .../Headers/HeadersH2NoButtonsBodyText.swift | 4 ++-- .../Headers/HeadersH2NoButtonsBodyTextModel.swift | 11 ++++------- MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift | 6 +++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift index 4443c137..ff903af2 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift @@ -8,7 +8,7 @@ import Foundation -@objcMembers open class HeadersH2NoButtonsBodyText: View { +@objcMembers open class HeadersH2NoButtonsBodyText: HeaderView { //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- @@ -20,7 +20,7 @@ import Foundation open override func setupView() { super.setupView() headlineBody.stylePageHeader() - addSubview(headlineBody) + addMolecule(headlineBody) NSLayoutConstraint.constraintPinSubview(toSuperview: headlineBody) } diff --git a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift index 59e244ca..3442d7d3 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift @@ -8,13 +8,11 @@ import Foundation -public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol { +public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public static var identifier: String = "headerH2" - public var backgroundColor: Color? public var headlineBody: HeadlineBodyModel //-------------------------------------------------- @@ -22,6 +20,7 @@ public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol { //-------------------------------------------------- public init(headlineBody: HeadlineBodyModel) { self.headlineBody = headlineBody + super.init() } //-------------------------------------------------- @@ -29,7 +28,6 @@ public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol { //-------------------------------------------------- private enum CodingKeys: String, CodingKey { case moleculeName - case backgroundColor case headlineBody } @@ -38,14 +36,13 @@ public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol { //-------------------------------------------------- required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + try super.init(from: decoder) } - public func encode(to encoder: Encoder) throws { + public override func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) - try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(headlineBody, forKey: .headlineBody) } } diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index f79fd315..8d15a2f2 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -107,17 +107,17 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextBodyText.self, viewModelClass: ListOneColumnFullWidthTextBodyTextModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) // TODO: Need model MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString) MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DateDropdownEntryField.self, forKey: "dateDropdownEntryField" as NSString) From dcc8cc0167caa23c73aeeaaf3abbdb6e2f37cee8 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 17 Mar 2020 17:34:38 +0530 Subject: [PATCH 14/43] code improvement. --- .../RightVariable/ListRightVariableTotalDataCaret.swift | 8 ++++---- .../ListRightVariableTotalDataCaretModel.swift | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift index 0be49a32..eeeb47de 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift @@ -24,10 +24,9 @@ import Foundation public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)), - (view: bar, model: StackItemModel(horizontalAlignment: .trailing)), - (view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))], + (view: bar, model: StackItemModel(horizontalAlignment: .fill)), + (view: rightLabel, model: StackItemModel(spacing: 4, horizontalAlignment: .fill))], axis: .horizontal) - bar.widthAnchor.constraint(equalToConstant: 20).isActive = true super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -41,8 +40,9 @@ import Foundation override open func setupView() { super.setupView() - rightLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) bar.setStyle(.heavy) + bar.widthAnchor.constraint(equalToConstant: 20).isActive = true + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) addMolecule(stack) } diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift index 6d1ba0c5..50a3e4c9 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift @@ -38,7 +38,6 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc case bar } - required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) @@ -54,6 +53,5 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc try container.encode(leftLabel, forKey: .leftLabel) try container.encode(rightLabel, forKey: .rightLabel) try container.encode(bar, forKey: .bar) - } } From 39077a769a7ab3e3837f30e61719b5c057951da2 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 17 Mar 2020 18:53:39 +0530 Subject: [PATCH 15/43] minor change. --- .../ListOneColumnFullWidthTextDividerSubsection.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift index 543f1158..8191da08 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift @@ -18,7 +18,9 @@ import Foundation // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),(view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))],axis: .vertical) + stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), + (view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))], + axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } From b30d582c12f9811f003ff133ae9cac84794cb7b5 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 17 Mar 2020 20:37:11 +0530 Subject: [PATCH 16/43] Removed the null additions. --- MVMCoreUI.xcodeproj/project.pbxproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 0762d87b..d6f92b56 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -129,8 +129,6 @@ 52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */; }; 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */; }; 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */; }; - 8D084A7F240CD9E500951227 /* (null) in Sources */ = {isa = PBXBuildFile; }; - 8D084A81240CDB5800951227 /* (null) in Sources */ = {isa = PBXBuildFile; }; 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */; }; 8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; @@ -1885,7 +1883,6 @@ D2A5145F2211DDC100345BFB /* MoleculeStackView.swift in Sources */, C7F8012323E846C300396FBD /* ListRVWheelModel.swift in Sources */, D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, - 8D084A7F240CD9E500951227 /* (null) in Sources */, C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */, 014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */, D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */, @@ -1938,7 +1935,6 @@ 0A7EF85B23D8A52800B2AAD1 /* EntryFieldModel.swift in Sources */, 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */, 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */, - 8D084A81240CDB5800951227 /* (null) in Sources */, 0A21DB8B235E06EF00C160A2 /* MFDigitTextBox.m in Sources */, D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */, D2B18B812360945C00A9AEDC /* View.swift in Sources */, From a24ea44e3c928e92e9ab8f513a9dd2a4608728ef Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 17 Mar 2020 20:41:14 +0530 Subject: [PATCH 17/43] Moved to Section Dividers folder. --- MVMCoreUI.xcodeproj/project.pbxproj | 12 ++++++++++-- ...ListOneColumnFullWidthTextDividerSubsection.swift | 0 ...neColumnFullWidthTextDividerSubsectionModel.swift | 0 3 files changed, 10 insertions(+), 2 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{List => SectionDividers}/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift (100%) rename MVMCoreUI/Molecules/DesignedComponents/{List => SectionDividers}/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 7e99354d..330602e4 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -884,8 +884,6 @@ 52267A0523FFE0A900906CBA /* OneColumn */ = { isa = PBXGroup; children = ( - BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */, - BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */, 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */, 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */, 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */, @@ -912,6 +910,15 @@ path = LockUps; sourceTree = ""; }; + 525665CB24211FD5007BF25F /* OneColumn */ = { + isa = PBXGroup; + children = ( + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */, + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */, + ); + path = OneColumn; + sourceTree = ""; + }; 526A265A240D1FCE00B0D828 /* TwoColumn */ = { isa = PBXGroup; children = ( @@ -1159,6 +1166,7 @@ D22B38EC23F4E10700490EF6 /* SectionDividers */ = { isa = PBXGroup; children = ( + 525665CB24211FD5007BF25F /* OneColumn */, 526A265A240D1FCE00B0D828 /* TwoColumn */, 525019E3240684E500EED91C /* FourColumn */, D22B38ED23F4E11100490EF6 /* ThreeColumn */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift similarity index 100% rename from MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift rename to MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift similarity index 100% rename from MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift From 7c301b10be94b236630f0ee975fe6a0b507b0cca Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 17 Mar 2020 20:46:33 +0530 Subject: [PATCH 18/43] code fixes. --- .../DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift | 1 - .../Headers/HeadersH2NoButtonsBodyTextModel.swift | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift index ff903af2..69bdbbba 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift @@ -21,7 +21,6 @@ import Foundation super.setupView() headlineBody.stylePageHeader() addMolecule(headlineBody) - NSLayoutConstraint.constraintPinSubview(toSuperview: headlineBody) } //---------------------------------------------------- diff --git a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift index 3442d7d3..d64656a2 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift @@ -41,6 +41,7 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol } public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) try container.encode(headlineBody, forKey: .headlineBody) From 602154df181d5e7d1dd7ecbe85ff77ca2b48b24b Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 17 Mar 2020 11:37:39 -0400 Subject: [PATCH 19/43] minor --- .../ListRightVariableTotalDataCaret.swift | 14 +++++++------- .../ListRightVariableTotalDataCaretModel.swift | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift index eeeb47de..abef078a 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift @@ -13,10 +13,10 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - var stack: Stack - let leftLabel = Label.commonLabelB1(true) - let rightLabel = Label.commonLabelB2(true) - let bar = Line() + public var stack: Stack + public let leftLabel = Label.commonLabelB1(true) + public let rightLabel = Label.commonLabelB2(true) + public let bar = Line() //----------------------------------------------------- // MARK: - Initializers @@ -44,19 +44,19 @@ import Foundation bar.widthAnchor.constraint(equalToConstant: 20).isActive = true rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) addMolecule(stack) + stack.restack() } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ super.set(with: model, delegateObject, additionalData) - guard let model = model as? ListRightVariableTotalDataModel else { return} + guard let model = model as? ListRightVariableTotalDataModel else { return } leftLabel.set(with: model.leftLabel, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) bar.set(with: model.bar, delegateObject, additionalData) - stack.restack() } open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{ - return 80 + return 70 } open override func reset() { diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift index 50a3e4c9..f0790391 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift @@ -13,7 +13,7 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc public static var identifier: String = "listRVLine" public var leftLabel: LabelModel public var rightLabel: LabelModel - public var bar : LineModel + public var bar: LineModel override public func setDefaults() { super.setDefaults() From ee7a2e253957c9a5793f19ecffa7e7e8ac124d47 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 17 Mar 2020 11:38:40 -0400 Subject: [PATCH 20/43] minor --- MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 641fdade..dcb46b79 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -80,7 +80,6 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: AccordionMoleculeTableViewCell.self, viewModelClass: AccordionListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TabsTableViewCell.self, viewModelClass: TabsListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListProgressBarData.self, viewModelClass: ListProgressBarDataModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRightVariableTotalData.self, viewModelClass: ListRightVariableTotalDataModel.self) // Other Items From 76b855db42ec492b4cb359380e4a119a35b060d6 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 17 Mar 2020 12:11:17 -0400 Subject: [PATCH 21/43] minor changes --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++--- .../ListRightVariableTotalData.swift | 25 ++++--- .../ListRightVariableTotalDataCaret.swift | 68 ------------------- ...ListRightVariableTotalDataCaretModel.swift | 57 ---------------- .../ListRightVariableTotalDataModel.swift | 12 +++- ...ColumnFullWidthTextDividerSubsection.swift | 10 +-- ...nFullWidthTextDividerSubsectionModel.swift | 2 +- .../OtherHandlers/MoleculeObjectMapping.swift | 17 ++--- 8 files changed, 42 insertions(+), 165 deletions(-) delete mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift delete mode 100644 MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 1bce4e5e..c9b6709e 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -127,8 +127,8 @@ 526A265E240D200500B0D828 /* ListTwoColumnCompareChanges.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */; }; 52B201D224081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */; }; 52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */; }; - 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */; }; - 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */; }; + 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataModel.swift */; }; + 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalData.swift */; }; 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */; }; 8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; @@ -503,8 +503,8 @@ 526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnCompareChanges.swift; sourceTree = ""; }; 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethod.swift; sourceTree = ""; }; 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethodModel.swift; sourceTree = ""; }; - 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataCaretModel.swift; sourceTree = ""; }; - 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataCaret.swift; sourceTree = ""; }; + 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalDataModel.swift; sourceTree = ""; }; + 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableTotalData.swift; sourceTree = ""; }; 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyTextModel.swift; sourceTree = ""; }; 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyText.swift; sourceTree = ""; }; 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = ""; }; @@ -958,8 +958,8 @@ children = ( AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */, AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */, - 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift */, - 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift */, + 8D070BAF241B56530099AC56 /* ListRightVariableTotalDataModel.swift */, + 8D070BB1241B56AD0099AC56 /* ListRightVariableTotalData.swift */, C7F8012223E846C300396FBD /* ListRVWheelModel.swift */, C7F8012023E8303200396FBD /* ListRVWheel.swift */, ); @@ -1827,7 +1827,7 @@ files = ( 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */, 0A5D59C223AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift in Sources */, - 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataCaretModel.swift in Sources */, + 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataModel.swift in Sources */, 943784F5236B77BB006A1E82 /* GraphView.swift in Sources */, 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */, 94C661DA23CCF4FB00D9FE5B /* UIColor+Extension.swift in Sources */, @@ -2041,7 +2041,7 @@ C695A68123C9830D00BFB94E /* NumberedListModel.swift in Sources */, 01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */, D27CD4102339057800C1DC07 /* EyebrowHeadlineBodyLink.swift in Sources */, - 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalDataCaret.swift in Sources */, + 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalData.swift in Sources */, D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */, D243859923A16B1800332775 /* Container.swift in Sources */, D2C521A923EDE79E00CA2634 /* ViewController.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift index 78ee9448..abef078a 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift @@ -13,10 +13,10 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - var stack: Stack - let leftLabel = Label.commonLabelB1(true) - let rightLabel = Label.commonLabelB2(true) - let bar = Line() + public var stack: Stack + public let leftLabel = Label.commonLabelB1(true) + public let rightLabel = Label.commonLabelB2(true) + public let bar = Line() //----------------------------------------------------- // MARK: - Initializers @@ -24,11 +24,9 @@ import Foundation public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)), - (view: bar, model: StackItemModel(horizontalAlignment: .trailing)), - (view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))], + (view: bar, model: StackItemModel(horizontalAlignment: .fill)), + (view: rightLabel, model: StackItemModel(spacing: 4, horizontalAlignment: .fill))], axis: .horizontal) - bar.widthAnchor.constraint(equalToConstant: 20).isActive = true - super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -42,21 +40,23 @@ import Foundation override open func setupView() { super.setupView() - rightLabel.setContentCompressionResistancePriority(UILayoutPriority(901), for: .horizontal) + bar.setStyle(.heavy) + bar.widthAnchor.constraint(equalToConstant: 20).isActive = true + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) addMolecule(stack) + stack.restack() } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ super.set(with: model, delegateObject, additionalData) - guard let model = model as? ListRightVariableTotalDataModel else { return} + guard let model = model as? ListRightVariableTotalDataModel else { return } leftLabel.set(with: model.leftLabel, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) bar.set(with: model.bar, delegateObject, additionalData) - stack.restack() } open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{ - return 90 + return 70 } open override func reset() { @@ -66,4 +66,3 @@ import Foundation bar.setStyle(.heavy) } } - diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift deleted file mode 100644 index abef078a..00000000 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift +++ /dev/null @@ -1,68 +0,0 @@ -// -// ListRightVariableTotalData.swift -// MVMCoreUI -// -// Created by Kruthika KP on 02/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers open class ListRightVariableTotalData: TableViewCell { - - //----------------------------------------------------- - // MARK: - Outlets - //----------------------------------------------------- - public var stack: Stack - public let leftLabel = Label.commonLabelB1(true) - public let rightLabel = Label.commonLabelB2(true) - public let bar = Line() - - //----------------------------------------------------- - // MARK: - Initializers - //----------------------------------------------------- - - public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)), - (view: bar, model: StackItemModel(horizontalAlignment: .fill)), - (view: rightLabel, model: StackItemModel(spacing: 4, horizontalAlignment: .fill))], - axis: .horizontal) - super.init(style: style, reuseIdentifier: reuseIdentifier) - } - - public required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - //----------------------------------------------------- - // MARK: - View Lifecycle - //------------------------------------------------------- - - override open func setupView() { - super.setupView() - bar.setStyle(.heavy) - bar.widthAnchor.constraint(equalToConstant: 20).isActive = true - rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) - addMolecule(stack) - stack.restack() - } - - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ - super.set(with: model, delegateObject, additionalData) - guard let model = model as? ListRightVariableTotalDataModel else { return } - leftLabel.set(with: model.leftLabel, delegateObject, additionalData) - rightLabel.set(with: model.rightLabel, delegateObject, additionalData) - bar.set(with: model.bar, delegateObject, additionalData) - } - - open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{ - return 70 - } - - open override func reset() { - super.reset() - leftLabel.styleB1(true) - rightLabel.styleB2(true) - bar.setStyle(.heavy) - } -} diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift deleted file mode 100644 index f0790391..00000000 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// ListRightVariableTotalDataModel.swift -// MVMCoreUI -// -// Created by Kruthika KP on 02/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol { - - public static var identifier: String = "listRVLine" - public var leftLabel: LabelModel - public var rightLabel: LabelModel - public var bar: LineModel - - override public func setDefaults() { - super.setDefaults() - rightLabel.hero = 0 - bar.type = .heavy - if bar.backgroundColor == nil { - bar.backgroundColor = Color(uiColor: .mvmBlue) - } - } - - public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){ - self.leftLabel = leftLabel - self.rightLabel = rightlabel - self.bar = bar - super.init() - } - - private enum CodingKeys: String, CodingKey{ - case moleculeName - case leftLabel - case rightLabel - case bar - } - - required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) - rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) - bar = try typeContainer.decode(LineModel.self, forKey: .bar) - try super.init(from: decoder) - } - - public override func encode(to encoder: Encoder) throws { - try super.encode(to: encoder) - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(moleculeName, forKey: .moleculeName) - try container.encode(leftLabel, forKey: .leftLabel) - try container.encode(rightLabel, forKey: .rightLabel) - try container.encode(bar, forKey: .bar) - } -} diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift index ec6299e0..f0790391 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataModel.swift @@ -13,7 +13,16 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc public static var identifier: String = "listRVLine" public var leftLabel: LabelModel public var rightLabel: LabelModel - public var bar : LineModel + public var bar: LineModel + + override public func setDefaults() { + super.setDefaults() + rightLabel.hero = 0 + bar.type = .heavy + if bar.backgroundColor == nil { + bar.backgroundColor = Color(uiColor: .mvmBlue) + } + } public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){ self.leftLabel = leftLabel @@ -44,6 +53,5 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc try container.encode(leftLabel, forKey: .leftLabel) try container.encode(rightLabel, forKey: .rightLabel) try container.encode(bar, forKey: .bar) - } } diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift index 8191da08..c1583583 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift @@ -12,14 +12,14 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - var stack: Stack - let headline = Label.commonLabelB1(true) - let body = Label.commonLabelB2(true) + public var stack: Stack + public let headline = Label.commonLabelB1(true) + public let body = Label.commonLabelB2(true) // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))], + (view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -37,7 +37,7 @@ import Foundation stack.restack() } - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.set(with: model, delegateObject, additionalData) guard let model = model as? ListOneColumnFullWidthTextDividerSubsectionModel else { return } headline.set(with: model.headline, delegateObject, additionalData) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift index bb39cf9e..04fb2e87 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsectionModel.swift @@ -8,7 +8,7 @@ import Foundation -public class ListOneColumnFullWidthTextDividerSubsectionModel: ListItemModel,MoleculeModelProtocol{ +public class ListOneColumnFullWidthTextDividerSubsectionModel: ListItemModel, MoleculeModelProtocol { public static var identifier: String = "list1CTxtDiv3" public var headline: LabelModel public var body: LabelModel diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 74e2a8e8..fd35ccba 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -80,7 +80,6 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: AccordionMoleculeTableViewCell.self, viewModelClass: AccordionListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TabsTableViewCell.self, viewModelClass: TabsListItemModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListProgressBarData.self, viewModelClass: ListProgressBarDataModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRightVariableTotalData.self, viewModelClass: ListRightVariableTotalDataModel.self) // Other Items MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackItem.self, viewModelClass: MoleculeStackItemModel.self) @@ -102,26 +101,22 @@ import Foundation // Designed List Items MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListLeftVariableIconWithRightCaret.self, viewModelClass: ListLeftVariableIconWithRightCaretModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListLeftVariableCheckboxAllTextAndLinks.self, viewModelClass: ListLeftVariableCheckboxAllTextAndLinksModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRightVariablePayments.self, viewModelClass: ListRightVariablePaymentsModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListLeftVariableRadioButtonAndPaymentMethod.self, viewModelClass: ListLeftVariableRadioButtonAndPaymentMethodModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRightVariablePayments.self, viewModelClass: ListRightVariablePaymentsModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRightVariableTotalData.self, viewModelClass: ListRightVariableTotalDataModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextBodyText.self, viewModelClass: ListOneColumnFullWidthTextBodyTextModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) - + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) // TODO: Need model - MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString) - MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DateDropdownEntryField.self, forKey: "dateDropdownEntryField" as NSString) - MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(Checkbox.self, forKey: "checkbox" as NSString) - MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(CheckboxLabel.self, forKey: "checkboxLabel" as NSString) MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(MVMCoreUIPageControl.self, forKey: "barsPager" as NSString) // TODO: Need View From 0f6ded4591679c9f0c1d660649def673985edc65 Mon Sep 17 00:00:00 2001 From: "Xinlei(Ryan) Pan" Date: Tue, 17 Mar 2020 15:08:27 -0400 Subject: [PATCH 22/43] move action models --- MVMCoreUI.xcodeproj/project.pbxproj | 16 +++++++++++++ .../ActionCollapseNotificationModel.swift | 21 ++++++++++++++++ MVMCoreUI/Actions/ActionTopAlertModel.swift | 24 +++++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 4 ++++ 4 files changed, 65 insertions(+) create mode 100644 MVMCoreUI/Actions/ActionCollapseNotificationModel.swift create mode 100644 MVMCoreUI/Actions/ActionTopAlertModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index b16286eb..d1d76cb3 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -154,6 +154,8 @@ 94AF4A3F23E9D13900676048 /* MFCaretButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94AF4A3D23E9D13900676048 /* MFCaretButton.m */; }; 94AF4A4223E9D19E00676048 /* MFCaretView.h in Headers */ = {isa = PBXBuildFile; fileRef = 94AF4A4023E9D19E00676048 /* MFCaretView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94AF4A4323E9D19E00676048 /* MFCaretView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94AF4A4123E9D19E00676048 /* MFCaretView.m */; }; + 94C0150A24215643005811A9 /* ActionTopAlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C0150924215643005811A9 /* ActionTopAlertModel.swift */; }; + 94C0150C2421564A005811A9 /* ActionCollapseNotificationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C0150B2421564A005811A9 /* ActionCollapseNotificationModel.swift */; }; 94C2D9842386F3F80006CF46 /* LabelAttributeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C2D9832386F3F80006CF46 /* LabelAttributeModel.swift */; }; 94C2D9A123872BCC0006CF46 /* LabelAttributeUnderlineModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C2D9A023872BCC0006CF46 /* LabelAttributeUnderlineModel.swift */; }; 94C2D9A323872C110006CF46 /* LabelAttributeStrikeThroughModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C2D9A223872C110006CF46 /* LabelAttributeStrikeThroughModel.swift */; }; @@ -533,6 +535,8 @@ 94AF4A3D23E9D13900676048 /* MFCaretButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFCaretButton.m; sourceTree = ""; }; 94AF4A4023E9D19E00676048 /* MFCaretView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFCaretView.h; sourceTree = ""; }; 94AF4A4123E9D19E00676048 /* MFCaretView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFCaretView.m; sourceTree = ""; }; + 94C0150924215643005811A9 /* ActionTopAlertModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionTopAlertModel.swift; sourceTree = ""; }; + 94C0150B2421564A005811A9 /* ActionCollapseNotificationModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionCollapseNotificationModel.swift; sourceTree = ""; }; 94C2D9832386F3F80006CF46 /* LabelAttributeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeModel.swift; sourceTree = ""; }; 94C2D9A023872BCC0006CF46 /* LabelAttributeUnderlineModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeUnderlineModel.swift; sourceTree = ""; }; 94C2D9A223872C110006CF46 /* LabelAttributeStrikeThroughModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeStrikeThroughModel.swift; sourceTree = ""; }; @@ -943,6 +947,15 @@ path = TwoColumn; sourceTree = ""; }; + 94C01508242155FE005811A9 /* Actions */ = { + isa = PBXGroup; + children = ( + 94C0150924215643005811A9 /* ActionTopAlertModel.swift */, + 94C0150B2421564A005811A9 /* ActionCollapseNotificationModel.swift */, + ); + path = Actions; + sourceTree = ""; + }; 94C2D9822386F3E30006CF46 /* Label */ = { isa = PBXGroup; children = ( @@ -1271,6 +1284,7 @@ D29DF11E21E6851E003B2FB9 /* TopAlert */, D29DF10D21E67A70003B2FB9 /* Atoms */, D29DF10E21E67A77003B2FB9 /* Molecules */, + 94C01508242155FE005811A9 /* Actions */, D22479902316A9CB003FCCF9 /* Organisms */, D29DF0DF21E418B2003B2FB9 /* Templates */, D29DF0CF21E404D4003B2FB9 /* MVMCoreUI.h */, @@ -1924,6 +1938,7 @@ 525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */, D2E2A99A23D8D6B4000B42E6 /* HeadlineBodyButtonModel.swift in Sources */, 8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */, + 94C0150C2421564A005811A9 /* ActionCollapseNotificationModel.swift in Sources */, 014AA73123C5059B006F3E93 /* ListPageTemplateModel.swift in Sources */, 017BEB4023620A230024EF95 /* TextFieldModel.swift in Sources */, D29DF2A221E7AF4E003B2FB9 /* MVMCoreUIUtility.m in Sources */, @@ -2049,6 +2064,7 @@ C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */, 0AE98BB523FF18D2004C5109 /* Arrow.swift in Sources */, D2D90B442404789000DD6EC9 /* MoleculeContainerProtocol.swift in Sources */, + 94C0150A24215643005811A9 /* ActionTopAlertModel.swift in Sources */, 012A88DB238ED45900FE3DA1 /* CarouselModel.swift in Sources */, D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */, 0AE14F64238315D2005417F8 /* TextField.swift in Sources */, diff --git a/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift new file mode 100644 index 00000000..17799ec2 --- /dev/null +++ b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift @@ -0,0 +1,21 @@ +// +// ActionCollapseNotificationModel.swift +// MVMCore +// +// Created by Ryan on 3/17/20. +// Copyright © 2020 myverizon. All rights reserved. +// + +import UIKit + +@objcMembers public class ActionCollapseNotificationModel: ActionModelProtocol { + public static var identifier: String = "collapseNotification" + + public var actionType: String? + + public var extraParameters: JSONValueDictionary? + + public var analyticsData: JSONValueDictionary? + + public var title: String? +} diff --git a/MVMCoreUI/Actions/ActionTopAlertModel.swift b/MVMCoreUI/Actions/ActionTopAlertModel.swift new file mode 100644 index 00000000..54746f31 --- /dev/null +++ b/MVMCoreUI/Actions/ActionTopAlertModel.swift @@ -0,0 +1,24 @@ +// +// ActionTopAlertModel.swift +// MVMCore +// +// Created by Suresh, Kamlesh on 12/16/19. +// Copyright © 2019 myverizon. All rights reserved. +// + +import Foundation + +@objcMembers public class ActionTopAlertModel: ActionModelProtocol { + + public static var identifier: String = "topAlert" + public var actionType: String? = ActionTopAlertModel.identifier + public var pageType: String + public var extraParameters: JSONValueDictionary? + public var analyticsData: JSONValueDictionary? + // Temporary fix till server changes + public var title: String? + + public init(pageType: String) { + self.pageType = pageType + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index a0d18912..b62eebfd 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -132,5 +132,9 @@ import Foundation try? ModelRegistry.register(RuleAllValueChangedModel.self) try? ModelRegistry.register(RuleEqualsModel.self) try? ModelRegistry.register(RuleRegexModel.self) + + // Actions + try? ModelRegistry.register(ActionTopAlertModel.self) + try? ModelRegistry.register(ActionCollapseNotificationModel.self) } } From aaeeb767aee8f084621323e13513a28e2cf2fe6c Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Tue, 17 Mar 2020 16:09:43 -0400 Subject: [PATCH 23/43] opening button access --- MVMCoreUI/Templates/ModalMoleculeListTemplate.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift index 6dae1700..3ad13f31 100644 --- a/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Templates/ModalMoleculeListTemplate.swift @@ -10,11 +10,12 @@ import UIKit open class ModalMoleculeListTemplate: MoleculeListTemplate { + public var closeButton: MFCustomButton? + override open func newDataBuildScreen() { super.newDataBuildScreen() - MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: {[weak self] _ in + closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in self?.dismiss() }, verticalCentered: false) } - } From a2c73d9d7dee782f9a24f6c375949dca89261a18 Mon Sep 17 00:00:00 2001 From: "Xinlei(Ryan) Pan" Date: Tue, 17 Mar 2020 16:17:58 -0400 Subject: [PATCH 24/43] add codable method to avoid set actionType value --- .../ActionCollapseNotificationModel.swift | 22 ++++++++++++++ MVMCoreUI/Actions/ActionTopAlertModel.swift | 29 ++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift index 17799ec2..9561b2ad 100644 --- a/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift +++ b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift @@ -18,4 +18,26 @@ import UIKit public var analyticsData: JSONValueDictionary? public var title: String? + + public enum CodingKeys: String, CodingKey { + case actionType + case title + case extraParameters + case analyticsData + } + + public required init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + title = try typeContainer.decodeIfPresent(String.self, forKey: .title) + extraParameters = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .extraParameters) + analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData) + } + + public func encode(to encoder: Encoder) throws { + var encoderContainer = encoder.container(keyedBy: CodingKeys.self) + try encoderContainer.encodeIfPresent(actionType, forKey: .actionType) + try encoderContainer.encodeIfPresent(title, forKey: .title) + try encoderContainer.encodeIfPresent(extraParameters, forKey: .extraParameters) + try encoderContainer.encodeIfPresent(analyticsData, forKey: .analyticsData) + } } diff --git a/MVMCoreUI/Actions/ActionTopAlertModel.swift b/MVMCoreUI/Actions/ActionTopAlertModel.swift index 54746f31..6e3f4dbd 100644 --- a/MVMCoreUI/Actions/ActionTopAlertModel.swift +++ b/MVMCoreUI/Actions/ActionTopAlertModel.swift @@ -11,7 +11,7 @@ import Foundation @objcMembers public class ActionTopAlertModel: ActionModelProtocol { public static var identifier: String = "topAlert" - public var actionType: String? = ActionTopAlertModel.identifier + public var actionType: String? public var pageType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? @@ -21,4 +21,31 @@ import Foundation public init(pageType: String) { self.pageType = pageType } + + public enum CodingKeys: String, CodingKey { + case actionType + case pageType + case title + case extraParameters + case analyticsData + } + + public required init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + pageType = try typeContainer.decode(String.self, forKey: .pageType) + title = try typeContainer.decodeIfPresent(String.self, forKey: .title) + extraParameters = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .extraParameters) + analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData) + } + + public func encode(to encoder: Encoder) throws { + var encoderContainer = encoder.container(keyedBy: CodingKeys.self) + try encoderContainer.encodeIfPresent(actionType, forKey: .actionType) + try encoderContainer.encode(pageType, forKey: .pageType) + try encoderContainer.encodeIfPresent(title, forKey: .title) + try encoderContainer.encodeIfPresent(extraParameters, forKey: .extraParameters) + try encoderContainer.encodeIfPresent(analyticsData, forKey: .analyticsData) + } + + } From 5b97fbfac08ea85d745b2cec478c6653667adeee Mon Sep 17 00:00:00 2001 From: "Xinlei(Ryan) Pan" Date: Tue, 17 Mar 2020 16:59:30 -0400 Subject: [PATCH 25/43] remove encode, decode method since actionType already handled by default encode behavior --- .../ActionCollapseNotificationModel.swift | 22 --------------- MVMCoreUI/Actions/ActionTopAlertModel.swift | 27 ------------------- 2 files changed, 49 deletions(-) diff --git a/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift index 9561b2ad..17799ec2 100644 --- a/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift +++ b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift @@ -18,26 +18,4 @@ import UIKit public var analyticsData: JSONValueDictionary? public var title: String? - - public enum CodingKeys: String, CodingKey { - case actionType - case title - case extraParameters - case analyticsData - } - - public required init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - title = try typeContainer.decodeIfPresent(String.self, forKey: .title) - extraParameters = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .extraParameters) - analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData) - } - - public func encode(to encoder: Encoder) throws { - var encoderContainer = encoder.container(keyedBy: CodingKeys.self) - try encoderContainer.encodeIfPresent(actionType, forKey: .actionType) - try encoderContainer.encodeIfPresent(title, forKey: .title) - try encoderContainer.encodeIfPresent(extraParameters, forKey: .extraParameters) - try encoderContainer.encodeIfPresent(analyticsData, forKey: .analyticsData) - } } diff --git a/MVMCoreUI/Actions/ActionTopAlertModel.swift b/MVMCoreUI/Actions/ActionTopAlertModel.swift index 6e3f4dbd..ac0d5684 100644 --- a/MVMCoreUI/Actions/ActionTopAlertModel.swift +++ b/MVMCoreUI/Actions/ActionTopAlertModel.swift @@ -21,31 +21,4 @@ import Foundation public init(pageType: String) { self.pageType = pageType } - - public enum CodingKeys: String, CodingKey { - case actionType - case pageType - case title - case extraParameters - case analyticsData - } - - public required init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - pageType = try typeContainer.decode(String.self, forKey: .pageType) - title = try typeContainer.decodeIfPresent(String.self, forKey: .title) - extraParameters = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .extraParameters) - analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData) - } - - public func encode(to encoder: Encoder) throws { - var encoderContainer = encoder.container(keyedBy: CodingKeys.self) - try encoderContainer.encodeIfPresent(actionType, forKey: .actionType) - try encoderContainer.encode(pageType, forKey: .pageType) - try encoderContainer.encodeIfPresent(title, forKey: .title) - try encoderContainer.encodeIfPresent(extraParameters, forKey: .extraParameters) - try encoderContainer.encodeIfPresent(analyticsData, forKey: .analyticsData) - } - - } From 6f46b51ac7e9731355fcd67c828903658c800b28 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Tue, 17 Mar 2020 22:53:40 -0400 Subject: [PATCH 26/43] delay --- MVMCoreUI/BaseControllers/MFViewController+Form.swift | 5 ++++- MVMCoreUI/BaseControllers/MFViewController.m | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/BaseControllers/MFViewController+Form.swift b/MVMCoreUI/BaseControllers/MFViewController+Form.swift index 2c3b14bf..73f12754 100644 --- a/MVMCoreUI/BaseControllers/MFViewController+Form.swift +++ b/MVMCoreUI/BaseControllers/MFViewController+Form.swift @@ -13,7 +13,10 @@ extension MFViewController: ObservingTextFieldDelegate { public extension MFViewController { @objc func startValidation() { - (self as? FormHolderProtocol)?.formValidator?.validate() + // Temporary fix with delay. + DispatchQueue.main.asyncAfter(deadline: .now() + 0.000001) { [weak self] in + (self as? FormHolderProtocol)?.formValidator?.validate() + } } @objc func addFormParams(requestParameters: MVMCoreRequestParameters) { diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index 7266c54f..a097e0f0 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -487,6 +487,7 @@ self.needToUpdateUI = YES; [self.view setNeedsLayout]; }]; + [self startValidation]; } - (void)didReceiveMemoryWarning { @@ -535,8 +536,6 @@ if (!self.disableAnimations) { [self.introAnimationManager performAnimations]; } - - [self startValidation]; } - (void)viewWillDisappear:(BOOL)animated { From 768b36a73939442e3eba629bf5cb794d152f26eb Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Tue, 17 Mar 2020 22:55:38 -0400 Subject: [PATCH 27/43] moving tp block --- MVMCoreUI/BaseControllers/MFViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index a097e0f0..fef3b860 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -484,10 +484,10 @@ - (void)newDataBuildAndUpdate { [MVMCoreDispatchUtility performBlockOnMainThread:^{ [self newDataBuildScreen]; + [self startValidation]; self.needToUpdateUI = YES; [self.view setNeedsLayout]; }]; - [self startValidation]; } - (void)didReceiveMemoryWarning { From 45805ebd2347db7121ba0e94c3485f1b7cd99d1e Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Wed, 18 Mar 2020 16:19:08 +0530 Subject: [PATCH 28/43] files moved to subsections folder --- MVMCoreUI.xcodeproj/project.pbxproj | 20 +++++++++++-------- ...eColumnTextWithWhitespaceDividerTall.swift | 6 +++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 2d816c5c..1226efed 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -173,10 +173,12 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; - BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; - BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; + BB6C6AC0242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6ABE242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */; }; + BB6C6AC1242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6ABF242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -550,10 +552,12 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; - BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; - BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; + BB6C6ABE242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ListOneColumnTextWithWhitespaceDividerTallModel.swift; path = MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift; sourceTree = SOURCE_ROOT; }; + BB6C6ABF242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ListOneColumnTextWithWhitespaceDividerTall.swift; path = MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift; sourceTree = SOURCE_ROOT; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -901,8 +905,6 @@ 52267A0523FFE0A900906CBA /* OneColumn */ = { isa = PBXGroup; children = ( - BB47A58124161003002BB23C /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */, - BB47A5832416101D002BB23C /* ListOneColumnTextWithWhitespaceDividerTall.swift */, 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */, 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */, 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */, @@ -932,6 +934,8 @@ 525665CB24211FD5007BF25F /* OneColumn */ = { isa = PBXGroup; children = ( + BB6C6ABE242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */, + BB6C6ABF242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift */, BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */, BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */, ); @@ -1890,11 +1894,11 @@ 9445890C2385BCE300DE9FD4 /* ProgressBarModel.swift in Sources */, 9445891F2385D2E900DE9FD4 /* CaretViewModel.swift in Sources */, 01C851D323CF9E740021F976 /* LabelToggleModel.swift in Sources */, - BB47A58224161003002BB23C /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */, D29DF2C521E7BF57003B2FB9 /* MFTabBarSwipeAnimator.m in Sources */, 011D95A3240453F8000E3791 /* RuleRegexModel.swift in Sources */, D2E2A98323D8B32D000B42E6 /* EyebrowHeadlineBodyLinkModel.swift in Sources */, 012A88AD238C418100FE3DA1 /* TemplateProtocol.swift in Sources */, + BB6C6AC1242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift in Sources */, D29DF2B421E7B76D003B2FB9 /* MFLoadingSpinner.m in Sources */, 011D9602240DA20A000E3791 /* ValidProtocol.swift in Sources */, D260106323D0C05000764D80 /* StackItemModel.swift in Sources */, @@ -1960,7 +1964,6 @@ 011D959B240451E3000E3791 /* RuleRequiredModel.swift in Sources */, 526A265C240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift in Sources */, 01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */, - BB47A5842416101D002BB23C /* ListOneColumnTextWithWhitespaceDividerTall.swift in Sources */, 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */, D260105523CEA7DC00764D80 /* MVMCoreUISwitch+Model.swift in Sources */, D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */, @@ -2036,6 +2039,7 @@ C7F8012123E8303200396FBD /* ListRVWheel.swift in Sources */, D29DF29521E7ADB8003B2FB9 /* ProgrammaticScrollViewController.m in Sources */, D2FB151B23A2B65B00C20E10 /* MoleculeContainer.swift in Sources */, + BB6C6AC0242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */, D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */, D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */, AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index fdc660fb..f8685b29 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -12,9 +12,9 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - var stack: Stack - let headline = Label.commonLabelH3(true) - let body = Label.commonLabelB2(true) + public var stack: Stack + public let headline = Label.commonLabelH3(true) + public let body = Label.commonLabelB2(true) // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { From 43accdfa7908451d2417fbaace2120406f9a9080 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Wed, 18 Mar 2020 16:34:22 +0530 Subject: [PATCH 29/43] Added code in mapping class --- MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index a0d18912..4efcde72 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -115,6 +115,8 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerTall.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerTallModel.self) + // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) From 4b6891851cbf4f2b39f2993978cc9b748dafc32a Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Wed, 18 Mar 2020 18:32:09 +0530 Subject: [PATCH 30/43] ListOneColumnTextWithWhitespaceDividerShort Molecule implemented --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++++-- ...ColumnTextWithWhitespaceDividerShort.swift | 56 +++++++++++++++++++ ...nTextWithWhitespaceDividerShortModel.swift | 48 ++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index b16286eb..1515117d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -173,10 +173,12 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; - BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; - BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; + BB6C6AC824225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6AC62422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift */; }; + BB6C6AC924225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6AC72422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -550,10 +552,12 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; - BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; - BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; + BB6C6AC62422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListOneColumnTextWithWhitespaceDividerShort.swift; sourceTree = ""; }; + BB6C6AC72422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListOneColumnTextWithWhitespaceDividerShortModel.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -930,6 +934,8 @@ 525665CB24211FD5007BF25F /* OneColumn */ = { isa = PBXGroup; children = ( + BB6C6AC72422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift */, + BB6C6AC62422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift */, BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */, BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */, ); @@ -2104,6 +2110,7 @@ DBC4391B224421A0001AB423 /* CaretLink.swift in Sources */, 0198F7A82256A80B0066C936 /* MFRadioButton.m in Sources */, 0A6BF4722360C56C0028F841 /* BaseDropdownEntryField.swift in Sources */, + BB6C6AC824225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift in Sources */, 0A41BA6E2344FCD400D4C0BC /* CATransaction+Extension.swift in Sources */, C7192E7D23C301750050C2A0 /* HeadLineBodyCaretLinkImage.swift in Sources */, D29DF13221E6851E003B2FB9 /* MVMCoreUITopAlertBaseView.m in Sources */, @@ -2117,6 +2124,7 @@ D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */, 011D959D2404536F000E3791 /* RuleAnyValueChangedModel.swift in Sources */, D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */, + BB6C6AC924225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift in Sources */, C695A69423C9909000BFB94E /* DoughnutChartModel.swift in Sources */, D29DF32421ED0DA2003B2FB9 /* TextButtonView.m in Sources */, D29E28DD23D7404C00ACEA85 /* ContainerHelper.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift new file mode 100644 index 00000000..c5ec73c0 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift @@ -0,0 +1,56 @@ +// +// ListOneColumnTextWithWhitespaceDividerShort.swift +// MVMCoreUI +// +// Created by Dhamodaram Nandi on 04/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +@objcMembers open class ListOneColumnTextWithWhitespaceDividerShort: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + var stack: Stack + let headline = Label.commonLabelH3(true) + let body = Label.commonLabelB2(true) + + // MARK: - Initializers + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), + (view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))], + axis: .vertical) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //----------------------------------------------------- + // MARK: - View Lifecycle + //----------------------------------------------------- + override open func setupView() { + super.setupView() + addMolecule(stack) + stack.restack() + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListOneColumnTextWithWhitespaceDividerShortModel else { return } + headline.set(with: model.headline, delegateObject, additionalData) + body.set(with: model.body, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } + + open override func reset() { + super.reset() + headline.styleH3(true) + body.styleB2(true) + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift new file mode 100644 index 00000000..feabb9e9 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift @@ -0,0 +1,48 @@ +// +// ListOneColumnTextWithWhitespaceDividerShortModel.swift +// MVMCoreUI +// +// Created by Dhamodaram Nandi on 04/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel,MoleculeModelProtocol{ + public static var identifier: String = "list1CTxtDiv1" + public var headline: LabelModel + public var body: LabelModel + + public init(headline: LabelModel, body: LabelModel) { + self.headline = headline + self.body = body + super.init() + } + + /// Defaults to set + override public func setDefaults() { + super.setDefaults() + style = "shortDivider" + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case headline + case body + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headline, forKey: .headline) + try container.encode(body, forKey: .body) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index a0d18912..5193becb 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -112,6 +112,7 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) // Designed Section Dividers + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerShort.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerShortModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) From 7db9308f8beb6461cef8ac1d24f6a5f49e859488 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 09:56:43 -0400 Subject: [PATCH 31/43] bugfix --- .../ListLeftVariableRadioButtonAndPaymentMethod.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index b4bb2fc3..12ae94fe 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -64,4 +64,8 @@ import UIKit open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return 90 } + + public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + radioButton.tapAction() + } } From 503a77efa117a0979f1424f69f7ae48aabdf803b Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Wed, 18 Mar 2020 19:39:26 +0530 Subject: [PATCH 32/43] spacing change. --- .../OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index f8685b29..105ee614 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -19,7 +19,7 @@ import Foundation // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))], + (view: body, model: StackItemModel(spacing: 0,horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -52,6 +52,5 @@ import Foundation super.reset() headline.styleH3(true) body.styleB2(true) - } } From 42b824549c77fc2b36ac48140f3b5cc50eb11772 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 18 Mar 2020 10:22:49 -0400 Subject: [PATCH 33/43] adding color --- MVMCoreUI/Categories/UIColor+Extension.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 9abedf97..81fe6743 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -42,7 +42,7 @@ extension UIColor { "orangeShade2": (.mvmOrangeShade2, "#984700"), "orangeAA": (.mvmOrangeAA, "#CC4D0F"), "blue": (.mvmBlue, "#0077B4"), - "blue33": (.mvmBlue33, "#57B1DF"), + "blue33": (.mvmBlue33, "#B1D8EF"), "blue66": (.mvmBlue66, "#57B1DF"), "blueShade1": (.mvmBlueShade1, "#136598"), "blueShade2": (.mvmBlueShade2, "#0B4467"), @@ -162,7 +162,7 @@ extension UIColor { /// HEX: #0077B4 public static let mvmBlue = UIColor.color8Bits(red: 0, green: 119, blue: 180) - /// HEX: #57B1DF + /// HEX: #B1D8EF public static let mvmBlue33 = UIColor.color8Bits(red: 87, green: 177, blue: 223) /// HEX: #57B1DF From 969d9601abc3fb2238d427da67438d5d3e1f3223 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Wed, 18 Mar 2020 10:26:52 -0400 Subject: [PATCH 34/43] main async --- MVMCoreUI/BaseControllers/MFViewController+Form.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MVMCoreUI/BaseControllers/MFViewController+Form.swift b/MVMCoreUI/BaseControllers/MFViewController+Form.swift index 73f12754..ef461a66 100644 --- a/MVMCoreUI/BaseControllers/MFViewController+Form.swift +++ b/MVMCoreUI/BaseControllers/MFViewController+Form.swift @@ -13,8 +13,7 @@ extension MFViewController: ObservingTextFieldDelegate { public extension MFViewController { @objc func startValidation() { - // Temporary fix with delay. - DispatchQueue.main.asyncAfter(deadline: .now() + 0.000001) { [weak self] in + DispatchQueue.main.async { [weak self] in (self as? FormHolderProtocol)?.formValidator?.validate() } } From 524cd4d6b071df41805dccaff9827fa1b523db43 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Wed, 18 Mar 2020 20:54:50 +0530 Subject: [PATCH 35/43] minor code changes. --- .../ListOneColumnTextWithWhitespaceDividerShort.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift index c5ec73c0..96432274 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift @@ -12,14 +12,14 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - var stack: Stack - let headline = Label.commonLabelH3(true) - let body = Label.commonLabelB2(true) + public var stack: Stack + public let headline = Label.commonLabelH3(true) + public let body = Label.commonLabelB2(true) // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(spacing: 5,horizontalAlignment: .leading))], + (view: body, model: StackItemModel(spacing: 0,horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } From a1942f84687105958ad018923d70d7410d23c7c5 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Wed, 18 Mar 2020 11:31:52 -0400 Subject: [PATCH 36/43] main thread --- MVMCoreUI/BaseControllers/MFViewController+Form.swift | 4 +--- MVMCoreUI/BaseControllers/MFViewController.m | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/BaseControllers/MFViewController+Form.swift b/MVMCoreUI/BaseControllers/MFViewController+Form.swift index ef461a66..2c3b14bf 100644 --- a/MVMCoreUI/BaseControllers/MFViewController+Form.swift +++ b/MVMCoreUI/BaseControllers/MFViewController+Form.swift @@ -13,9 +13,7 @@ extension MFViewController: ObservingTextFieldDelegate { public extension MFViewController { @objc func startValidation() { - DispatchQueue.main.async { [weak self] in - (self as? FormHolderProtocol)?.formValidator?.validate() - } + (self as? FormHolderProtocol)?.formValidator?.validate() } @objc func addFormParams(requestParameters: MVMCoreRequestParameters) { diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index fef3b860..52cf01cf 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -484,7 +484,9 @@ - (void)newDataBuildAndUpdate { [MVMCoreDispatchUtility performBlockOnMainThread:^{ [self newDataBuildScreen]; - [self startValidation]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self startValidation]; + }); self.needToUpdateUI = YES; [self.view setNeedsLayout]; }]; From 3210d8cc8818aa8d7cac53fb673cd862d30dd7df Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 13:25:44 -0400 Subject: [PATCH 37/43] cleanup --- MVMCoreUI.xcodeproj/project.pbxproj | 6 +++- .../ActionCollapseNotificationModel.swift | 4 --- MVMCoreUI/Actions/ActionOpenPanelModel.swift | 31 +++++++++++++++++++ MVMCoreUI/Actions/ActionTopAlertModel.swift | 1 - .../OtherHandlers/MoleculeObjectMapping.swift | 1 + .../Templates/ListPageTemplateModel.swift | 2 ++ .../StackCenteredPageTemplateModel.swift | 24 +++++++------- .../Templates/StackPageTemplateModel.swift | 2 ++ .../ThreeLayerPageTemplateModel.swift | 2 ++ 9 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 MVMCoreUI/Actions/ActionOpenPanelModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index d1d76cb3..40550124 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -368,6 +368,7 @@ 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 */; }; D2C521A923EDE79E00CA2634 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2C521A823EDE79E00CA2634 /* ViewController.swift */; }; + D2C78CD224228BBD00B69FDE /* ActionOpenPanelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2C78CD124228BBD00B69FDE /* ActionOpenPanelModel.swift */; }; D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */; }; D2D6CD4222E78FAB00D701B8 /* ThreeLayerTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D6CD4122E78FAB00D701B8 /* ThreeLayerTemplate.swift */; }; D2D90B42240463E100DD6EC9 /* MoleculeHeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D90B41240463E100DD6EC9 /* MoleculeHeaderModel.swift */; }; @@ -761,6 +762,7 @@ D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIViewControllerMappingObject.h; sourceTree = ""; }; D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIViewControllerMappingObject.m; sourceTree = ""; }; D2C521A823EDE79E00CA2634 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + D2C78CD124228BBD00B69FDE /* ActionOpenPanelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionOpenPanelModel.swift; sourceTree = ""; }; D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scroller.swift; sourceTree = ""; }; D2D6CD4122E78FAB00D701B8 /* ThreeLayerTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerTemplate.swift; sourceTree = ""; }; D2D90B41240463E100DD6EC9 /* MoleculeHeaderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeHeaderModel.swift; sourceTree = ""; }; @@ -952,6 +954,7 @@ children = ( 94C0150924215643005811A9 /* ActionTopAlertModel.swift */, 94C0150B2421564A005811A9 /* ActionCollapseNotificationModel.swift */, + D2C78CD124228BBD00B69FDE /* ActionOpenPanelModel.swift */, ); path = Actions; sourceTree = ""; @@ -1282,9 +1285,9 @@ D22D1F582204D2590077CEC0 /* Legacy */, D29DF10F21E67A7D003B2FB9 /* BaseControllers */, D29DF11E21E6851E003B2FB9 /* TopAlert */, + 94C01508242155FE005811A9 /* Actions */, D29DF10D21E67A70003B2FB9 /* Atoms */, D29DF10E21E67A77003B2FB9 /* Molecules */, - 94C01508242155FE005811A9 /* Actions */, D22479902316A9CB003FCCF9 /* Organisms */, D29DF0DF21E418B2003B2FB9 /* Templates */, D29DF0CF21E404D4003B2FB9 /* MVMCoreUI.h */, @@ -2069,6 +2072,7 @@ D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */, 0AE14F64238315D2005417F8 /* TextField.swift in Sources */, D29DF17B21E69E1F003B2FB9 /* PrimaryButton.m in Sources */, + D2C78CD224228BBD00B69FDE /* ActionOpenPanelModel.swift in Sources */, 017BEB4A236235BA0024EF95 /* ModelMoleculeViewProtocol.swift in Sources */, C695A68123C9830D00BFB94E /* NumberedListModel.swift in Sources */, 01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */, diff --git a/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift index 17799ec2..4dad156b 100644 --- a/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift +++ b/MVMCoreUI/Actions/ActionCollapseNotificationModel.swift @@ -10,12 +10,8 @@ import UIKit @objcMembers public class ActionCollapseNotificationModel: ActionModelProtocol { public static var identifier: String = "collapseNotification" - public var actionType: String? - public var extraParameters: JSONValueDictionary? - public var analyticsData: JSONValueDictionary? - public var title: String? } diff --git a/MVMCoreUI/Actions/ActionOpenPanelModel.swift b/MVMCoreUI/Actions/ActionOpenPanelModel.swift new file mode 100644 index 00000000..ce3977d8 --- /dev/null +++ b/MVMCoreUI/Actions/ActionOpenPanelModel.swift @@ -0,0 +1,31 @@ +// +// ActionOpenPanelModel.swift +// MVMCore +// +// Created by Khan, Arshad on 12/02/20. +// Copyright © 2020 myverizon. All rights reserved. +// + +import Foundation + +public class ActionOpenPanelModel: ActionModelProtocol { + + public enum Panel: String, Codable { + case left + case right + case support // Legacy, means left + case menu // Legacy, means right. + } + + public static var identifier: String = "openPanel" + public var actionType: String? + public var panel: Panel + public var extraParameters: JSONValueDictionary? + public var analyticsData: JSONValueDictionary? + // Temporary fix till server changes + public var title: String? + + public init(panel: Panel) { + self.panel = panel + } +} diff --git a/MVMCoreUI/Actions/ActionTopAlertModel.swift b/MVMCoreUI/Actions/ActionTopAlertModel.swift index ac0d5684..6da64912 100644 --- a/MVMCoreUI/Actions/ActionTopAlertModel.swift +++ b/MVMCoreUI/Actions/ActionTopAlertModel.swift @@ -9,7 +9,6 @@ import Foundation @objcMembers public class ActionTopAlertModel: ActionModelProtocol { - public static var identifier: String = "topAlert" public var actionType: String? public var pageType: String diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index b62eebfd..8617ba0b 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -136,5 +136,6 @@ import Foundation // Actions try? ModelRegistry.register(ActionTopAlertModel.self) try? ModelRegistry.register(ActionCollapseNotificationModel.self) + try? ModelRegistry.register(ActionOpenPanelModel.self) } } diff --git a/MVMCoreUI/Templates/ListPageTemplateModel.swift b/MVMCoreUI/Templates/ListPageTemplateModel.swift index 12c300f9..f48e53e4 100644 --- a/MVMCoreUI/Templates/ListPageTemplateModel.swift +++ b/MVMCoreUI/Templates/ListPageTemplateModel.swift @@ -44,6 +44,7 @@ import Foundation private enum CodingKeys: String, CodingKey { case moleculeName + case template case pageType case screenHeading case molecules @@ -73,6 +74,7 @@ import Foundation public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(pageType, forKey: .pageType) + try container.encode(template, forKey: .template) try container.encodeIfPresent(screenHeading, forKey: .screenHeading) try container.encodeModelsIfPresent(molecules, forKey: .molecules) try container.encodeIfPresent(isAtomicTabs, forKey: .isAtomicTabs) diff --git a/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift b/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift index 66cd0365..bc39fbf9 100644 --- a/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift +++ b/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift @@ -23,22 +23,24 @@ import Foundation } private enum CodingKeys: String, CodingKey { - case pageType - case screenHeading - case isAtomicTabs + case pageType + case template + case screenHeading + case isAtomicTabs } required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - pageType = try typeContainer.decode(String.self, forKey: .pageType) - screenHeading = try typeContainer.decodeIfPresent(String.self, forKey: .screenHeading) - isAtomicTabs = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAtomicTabs) + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + pageType = try typeContainer.decode(String.self, forKey: .pageType) + screenHeading = try typeContainer.decodeIfPresent(String.self, forKey: .screenHeading) + isAtomicTabs = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAtomicTabs) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(pageType, forKey: .pageType) - try container.encodeIfPresent(screenHeading, forKey: .screenHeading) - try container.encodeIfPresent(isAtomicTabs, forKey: .isAtomicTabs) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(pageType, forKey: .pageType) + try container.encode(template, forKey: .template) + try container.encodeIfPresent(screenHeading, forKey: .screenHeading) + try container.encodeIfPresent(isAtomicTabs, forKey: .isAtomicTabs) } } diff --git a/MVMCoreUI/Templates/StackPageTemplateModel.swift b/MVMCoreUI/Templates/StackPageTemplateModel.swift index ed94e4ef..74cb72b8 100644 --- a/MVMCoreUI/Templates/StackPageTemplateModel.swift +++ b/MVMCoreUI/Templates/StackPageTemplateModel.swift @@ -30,6 +30,7 @@ import Foundation private enum CodingKeys: String, CodingKey { case pageType + case template case screenHeading case header case footer @@ -52,6 +53,7 @@ import Foundation public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(pageType, forKey: .pageType) + try container.encode(template, forKey: .template) try container.encode(moleculeStack, forKey: .stack) try container.encodeIfPresent(screenHeading, forKey: .screenHeading) try container.encodeIfPresent(isAtomicTabs, forKey: .isAtomicTabs) diff --git a/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift b/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift index 5ad39c4b..f42a3bbd 100644 --- a/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift +++ b/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift @@ -32,6 +32,7 @@ import Foundation private enum CodingKeys: String, CodingKey { case pageType + case template case screenHeading case header case footer @@ -52,6 +53,7 @@ import Foundation public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(pageType, forKey: .pageType) + try container.encode(template, forKey: .template) try container.encodeIfPresent(screenHeading, forKey: .screenHeading) try container.encodeIfPresent(isAtomicTabs, forKey: .isAtomicTabs) try container.encodeModelIfPresent(header, forKey: .header) From 9b941285956c7f8dbb56f59cd292af7f66596c31 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 13:32:17 -0400 Subject: [PATCH 38/43] remove key --- MVMCoreUI/Templates/ListPageTemplateModel.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/MVMCoreUI/Templates/ListPageTemplateModel.swift b/MVMCoreUI/Templates/ListPageTemplateModel.swift index f48e53e4..e7eac47f 100644 --- a/MVMCoreUI/Templates/ListPageTemplateModel.swift +++ b/MVMCoreUI/Templates/ListPageTemplateModel.swift @@ -43,7 +43,6 @@ import Foundation //-------------------------------------------------- private enum CodingKeys: String, CodingKey { - case moleculeName case template case pageType case screenHeading From d556d4b14a8c0e7411add8159f59a3d9a8d1f4f1 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 13:39:48 -0400 Subject: [PATCH 39/43] form rules --- MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift | 3 +++ MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift | 3 +++ 2 files changed, 6 insertions(+) diff --git a/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift b/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift index bc39fbf9..117d624c 100644 --- a/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift +++ b/MVMCoreUI/Templates/StackCenteredPageTemplateModel.swift @@ -27,6 +27,7 @@ import Foundation case template case screenHeading case isAtomicTabs + case formRules } required public init(from decoder: Decoder) throws { @@ -34,6 +35,7 @@ import Foundation pageType = try typeContainer.decode(String.self, forKey: .pageType) screenHeading = try typeContainer.decodeIfPresent(String.self, forKey: .screenHeading) isAtomicTabs = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAtomicTabs) + formRules = try typeContainer.decodeIfPresent([FormGroupRule].self, forKey: .formRules) } public func encode(to encoder: Encoder) throws { @@ -42,5 +44,6 @@ import Foundation try container.encode(template, forKey: .template) try container.encodeIfPresent(screenHeading, forKey: .screenHeading) try container.encodeIfPresent(isAtomicTabs, forKey: .isAtomicTabs) + try container.encodeIfPresent(formRules, forKey: .formRules) } } diff --git a/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift b/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift index f42a3bbd..dcd4aa9f 100644 --- a/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift +++ b/MVMCoreUI/Templates/ThreeLayerPageTemplateModel.swift @@ -38,6 +38,7 @@ import Foundation case footer case middle case isAtomicTabs + case formRules } required public init(from decoder: Decoder) throws { @@ -48,6 +49,7 @@ import Foundation header = try typeContainer.decodeModelIfPresent(codingKey: .header) middle = try typeContainer.decodeModelIfPresent(codingKey: .middle) footer = try typeContainer.decodeModelIfPresent(codingKey: .footer) + formRules = try typeContainer.decodeIfPresent([FormGroupRule].self, forKey: .formRules) } public func encode(to encoder: Encoder) throws { @@ -59,5 +61,6 @@ import Foundation try container.encodeModelIfPresent(header, forKey: .header) try container.encodeModelIfPresent(header, forKey: .middle) try container.encodeModelIfPresent(footer, forKey: .footer) + try container.encodeIfPresent(formRules, forKey: .formRules) } } From 9baf3948ad9de6dc8bcc46685f4b95a01026ac07 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 18 Mar 2020 14:05:01 -0400 Subject: [PATCH 40/43] touchup --- MVMCoreUI/Atoms/Views/RadioButton.swift | 62 ++++++++++++++------ MVMCoreUI/Atoms/Views/RadioButtonModel.swift | 31 ++++++++-- 2 files changed, 70 insertions(+), 23 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/RadioButton.swift b/MVMCoreUI/Atoms/Views/RadioButton.swift index ce95c639..7dd5976a 100644 --- a/MVMCoreUI/Atoms/Views/RadioButton.swift +++ b/MVMCoreUI/Atoms/Views/RadioButton.swift @@ -8,31 +8,30 @@ import UIKit -@objcMembers public class RadioButton: Control { +@objcMembers open class RadioButton: Control { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- - var diameter: CGFloat = 30 { + public var diameter: CGFloat = 30 { didSet { widthConstraint?.constant = diameter } } - var enabledColor = UIColor.black - var disabledColor = UIColor.mfSilver() - var delegateObject: MVMCoreUIDelegateObject? - - var widthConstraint: NSLayoutConstraint? - var heightConstraint: NSLayoutConstraint? - - var radioModel: RadioButtonModel? { + public var enabledColor: UIColor = .black + public var disabledColor: UIColor = .mfSilver() + public var delegateObject: MVMCoreUIDelegateObject? + + public var radioModel: RadioButtonModel? { return model as? RadioButtonModel } - lazy var radioGroupName: String? = { + lazy public var radioGroupName: String? = { [unowned self] in return radioModel?.fieldKey }() - lazy var radioButtonSelectionHelper: RadioButtonSelectionHelper? = { - [unowned self] in + lazy public var radioButtonSelectionHelper: RadioButtonSelectionHelper? = { if let radioGroupName = radioGroupName, let radioButtonModel = delegateObject?.formHolderDelegate?.formValidator?.radioButtonsModelByGroup[radioGroupName] { return radioButtonModel @@ -41,20 +40,40 @@ import UIKit } }() + //-------------------------------------------------- + // MARK: - Constraints + //-------------------------------------------------- + + public var widthConstraint: NSLayoutConstraint? + public var heightConstraint: NSLayoutConstraint? + + //-------------------------------------------------- + // MARK: - Lifecycle + //-------------------------------------------------- + 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.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() } } + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + /// The action performed when tapped. func tapAction() { if let radioButtonModel = radioButtonSelectionHelper { @@ -82,9 +101,13 @@ import UIKit return radioModel?.fieldValue } -// MARK: - MVMViewProtocol + //-------------------------------------------------- + // MARK: - MVMViewProtocol + //-------------------------------------------------- + open override func setupView() { super.setupView() + backgroundColor = .white clipsToBounds = true widthConstraint = widthAnchor.constraint(equalToConstant: 30) @@ -98,12 +121,13 @@ import UIKit accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") } - public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { super.set(with: model, delegateObject, additionalData) - guard let model = model as? RadioButtonModel else { - return - } + + guard let model = model as? RadioButtonModel else { return } + self.delegateObject = delegateObject + isSelected = model.state let radioButtonModel = RadioButtonSelectionHelper.setupForRadioButtonGroup(model, formValidator: delegateObject?.formHolderDelegate?.formValidator) FormValidator.setupValidation(molecule: radioButtonModel, delegate: delegateObject?.formHolderDelegate) diff --git a/MVMCoreUI/Atoms/Views/RadioButtonModel.swift b/MVMCoreUI/Atoms/Views/RadioButtonModel.swift index 0aa56cc0..581e03f8 100644 --- a/MVMCoreUI/Atoms/Views/RadioButtonModel.swift +++ b/MVMCoreUI/Atoms/Views/RadioButtonModel.swift @@ -9,18 +9,26 @@ import Foundation import MVMCore -public class RadioButtonModel: MoleculeModelProtocol, FormFieldProtocol { +open class RadioButtonModel: MoleculeModelProtocol, FormFieldProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + public static var identifier: String = "radioButton" public var backgroundColor: Color? public var state: Bool = false public var enabled: Bool = true - + public var baseValue: AnyHashable? public var groupName: String? public var fieldKey: String? public var fieldValue: String? + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { case moleculeName case backgroundColor @@ -31,22 +39,37 @@ public class RadioButtonModel: MoleculeModelProtocol, FormFieldProtocol { case groupName } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(_ state: Bool) { self.state = state } - + + //-------------------------------------------------- + // MARK: - Method + //-------------------------------------------------- + public func formFieldValue() -> AnyHashable? { return state } - + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + if let state = try typeContainer.decodeIfPresent(Bool.self, forKey: .state) { self.state = state } + if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) { self.enabled = enabled } + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) fieldKey = try typeContainer.decodeIfPresent(String.self, forKey: .fieldKey) groupName = try typeContainer.decodeIfPresent(String.self, forKey: .groupName) From 572568ca6f09d1f5a5f877b706be8211ed294e7d Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 14:23:37 -0400 Subject: [PATCH 41/43] missed spacing --- .../ListOneColumnTextWithWhitespaceDividerTall.swift | 4 ++-- .../ListOneColumnTextWithWhitespaceDividerTallModel.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index 105ee614..1f2bcd6f 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -19,7 +19,7 @@ import Foundation // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(spacing: 0,horizontalAlignment: .leading))], + (view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -37,7 +37,7 @@ import Foundation stack.restack() } - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.set(with: model, delegateObject, additionalData) guard let model = model as? ListOneColumnTextWithWhitespaceDividerTallModel else { return } headline.set(with: model.headline, delegateObject, additionalData) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift index f93f601b..7c95b7e8 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift @@ -8,7 +8,7 @@ import Foundation -public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel,MoleculeModelProtocol{ +public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, MoleculeModelProtocol { public static var identifier: String = "list1CTxtDiv2" public var headline: LabelModel public var body: LabelModel From 8a6cd8984559add1bf8c84e9c744eeb9197e6f98 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 14:31:56 -0400 Subject: [PATCH 42/43] spacing --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++++---- .../ListOneColumnTextWithWhitespaceDividerShort.swift | 4 ++-- ...ListOneColumnTextWithWhitespaceDividerShortModel.swift | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index b9ce9b73..f17d7906 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -181,7 +181,7 @@ BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; BB6C6AC0242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6ABE242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */; }; BB6C6AC1242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6ABF242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift */; }; - BB6C6AC824225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6AC62422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift */; }; + BB6C6AC824225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6AC62422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift */; }; BB6C6AC924225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB6C6AC72422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; @@ -567,7 +567,7 @@ BB6C6ABF242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ListOneColumnTextWithWhitespaceDividerTall.swift; path = MVMCoreUI/Molecules/DesignedComponents/List/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift; sourceTree = SOURCE_ROOT; }; BB6C6AC62422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListOneColumnTextWithWhitespaceDividerShort.swift; sourceTree = ""; }; BB6C6AC72422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListOneColumnTextWithWhitespaceDividerShortModel.swift; sourceTree = ""; }; - C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; + C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; C695A68023C9830D00BFB94E /* NumberedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberedListModel.swift; sourceTree = ""; }; @@ -944,10 +944,10 @@ 525665CB24211FD5007BF25F /* OneColumn */ = { isa = PBXGroup; children = ( - BB6C6ABE242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */, - BB6C6ABF242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift */, BB6C6AC72422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShortModel.swift */, BB6C6AC62422528F005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift */, + BB6C6ABE242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift */, + BB6C6ABF242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift */, BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */, BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */, ); diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift index 96432274..ec65967d 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift @@ -19,7 +19,7 @@ import Foundation // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(spacing: 0,horizontalAlignment: .leading))], + (view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -37,7 +37,7 @@ import Foundation stack.restack() } - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.set(with: model, delegateObject, additionalData) guard let model = model as? ListOneColumnTextWithWhitespaceDividerShortModel else { return } headline.set(with: model.headline, delegateObject, additionalData) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift index feabb9e9..340ccddc 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift @@ -8,7 +8,7 @@ import Foundation -public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel,MoleculeModelProtocol{ +public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, MoleculeModelProtocol { public static var identifier: String = "list1CTxtDiv1" public var headline: LabelModel public var body: LabelModel From 422e041c45374f5a7aa0d0a87a15aa9bcc9e0e90 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 14:49:46 -0400 Subject: [PATCH 43/43] change to make git happy --- MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 5d7afdcc..f2bf9e78 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -112,12 +112,11 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) // Designed Section Dividers - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerShort.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerShortModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerShort.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerShortModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerTall.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerTallModel.self) - + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self)