From 7702b24d4ad8a749b670bab77870b0c792d3795d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 19 Feb 2020 12:27:16 +0530 Subject: [PATCH 01/12] 19036 - List - Two Column - Price - Details initial commit. Added molecule and model class. --- MVMCoreUI.xcodeproj/project.pbxproj | 16 +++++ .../TwoColumn/ListTwoColumnPriceDetails.swift | 71 +++++++++++++++++++ .../ListTwoColumnPriceDetailsModel.swift | 47 ++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 135 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 03743382..bc01f6c7 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -128,6 +128,8 @@ 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; + AAB04E4E23FCE7ED007C79B0 /* ListTwoColumnPriceDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB04E4D23FCE7ED007C79B0 /* ListTwoColumnPriceDetails.swift */; }; + AAB04E5023FCE7FB007C79B0 /* ListTwoColumnPriceDetailsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB04E4F23FCE7FB007C79B0 /* ListTwoColumnPriceDetailsModel.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 */; }; @@ -451,6 +453,8 @@ 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; + AAB04E4D23FCE7ED007C79B0 /* ListTwoColumnPriceDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetails.swift; sourceTree = ""; }; + AAB04E4F23FCE7FB007C79B0 /* ListTwoColumnPriceDetailsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetailsModel.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 = ""; }; @@ -782,6 +786,15 @@ name = "Recovered References"; sourceTree = ""; }; + AAB04E4C23FCE7AC007C79B0 /* TwoColumn */ = { + isa = PBXGroup; + children = ( + AAB04E4D23FCE7ED007C79B0 /* ListTwoColumnPriceDetails.swift */, + AAB04E4F23FCE7FB007C79B0 /* ListTwoColumnPriceDetailsModel.swift */, + ); + path = TwoColumn; + sourceTree = ""; + }; D213347423842FE3008E41B3 /* Controllers */ = { isa = PBXGroup; children = ( @@ -980,6 +993,7 @@ D22B38EC23F4E10700490EF6 /* SectionDividers */ = { isa = PBXGroup; children = ( + AAB04E4C23FCE7AC007C79B0 /* TwoColumn */, D22B38ED23F4E11100490EF6 /* ThreeColumn */, ); path = SectionDividers; @@ -1625,6 +1639,7 @@ D22D1F1F220343560077CEC0 /* MVMCoreUICheckMarkView.m in Sources */, D2E2A99423D8CCBC000B42E6 /* HeadlineBodyLinkModel.swift in Sources */, 01004F3022721C3800991ECC /* RadioButton.swift in Sources */, + AAB04E5023FCE7FB007C79B0 /* ListTwoColumnPriceDetailsModel.swift in Sources */, D268C70E238C22D7007F2C1C /* DropDownFilterTableViewCell.swift in Sources */, 017BEB3C2361EA1D0024EF95 /* MFViewController+Model.swift in Sources */, D282AAB4223FDDAE00C46919 /* MFLoadImageView.swift in Sources */, @@ -1678,6 +1693,7 @@ 0A21DB85235E06EF00C160A2 /* MFTextField.m in Sources */, 014AA72623C501E2006F3E93 /* ContainerModelProtocol.swift in Sources */, 01EB369223609801006832FA /* MoleculeStackModel.swift in Sources */, + AAB04E4E23FCE7ED007C79B0 /* ListTwoColumnPriceDetails.swift in Sources */, 012CA99E2385A2D3003F810F /* MFView+ModelExtension.swift in Sources */, D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */, 944589232385DA9600DE9FD4 /* ImageViewModel.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift new file mode 100644 index 00000000..804918b2 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -0,0 +1,71 @@ +// +// ListTwoColumnPriceDetails.swift +// MVMCoreUI +// +// Created by Lekshmi S on 19/02/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +@objcMembers open class ListTwoColumnPriceDetails: TableViewCell { + + let leftLabel = Label.commonLabelB2(true) + let rightLabel = Label.commonLabelB2(true) + let rightSubLabel = Label.commonLabelB2(true) + let containerView = View() + + // MARK: - MFViewProtocol + open override func updateView(_ size: CGFloat) { + super.updateView(size) + containerView.updateView(size) + leftLabel.updateView(size) + rightLabel.updateView(size) + rightSubLabel.updateView(size) + } + + open override func setupView() { + super.setupView() + + guard leftLabel.superview == nil else { + return + } + containerView.translatesAutoresizingMaskIntoConstraints = false + contentView.addSubview(containerView) + containerView.addSubview(leftLabel) + containerView.addSubview(rightLabel) + containerView.addSubview(rightSubLabel) + + //containerView constraints + containerHelper.constrainView(containerView) + //leftLabel constraints + leftLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true + leftLabel.centerYAnchor.constraint(equalTo: rightLabel.centerYAnchor).isActive = true + //rightLabel constraints + rightLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true + rightLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true + //rightSubLabel constraints + rightSubLabel.topAnchor.constraint(equalTo: rightLabel.bottomAnchor).isActive = true + rightSubLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true + containerView.bottomAnchor.constraint(equalTo: rightSubLabel.bottomAnchor).isActive = true + } + + // MARK: - MVMCoreUIMoleculeViewProtocol + public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.setWithModel(model, delegateObject, additionalData) + guard let model = model as? ListTwoColumnPriceDetailsModel else { return } + leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData) + rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) + rightSubLabel.setWithModel(model.rightSubLabel, delegateObject, additionalData) + } + + open override func reset() { + super.reset() + leftLabel.reset() + rightLabel.reset() + rightSubLabel.reset() + } + + public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 60 + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift new file mode 100644 index 00000000..52bf3e10 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift @@ -0,0 +1,47 @@ +// +// ListTwoColumnPriceDetailsModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 19/02/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol { + public static var identifier: String = "list2CTxtPrc2" + public var leftLabel: LabelModel + public var rightLabel: LabelModel + public var rightSubLabel: LabelModel + + public init(leftLabel: LabelModel, rightLabel:LabelModel, rightSubLabel: LabelModel) { + self.leftLabel = leftLabel + self.rightLabel = rightLabel + self.rightSubLabel = rightSubLabel + super.init() + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case leftLabel + case rightLabel + case rightSubLabel + } + + 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) + rightSubLabel = try typeContainer.decode(LabelModel.self, forKey: .rightSubLabel) + 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(rightSubLabel, forKey: .rightSubLabel) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index a04f964a..c3b3523b 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -55,6 +55,7 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: StringAndMoleculeView.self, viewModelClass: StringAndMoleculeModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ImageHeadlineBody.self, viewModelClass: ImageHeadlineBodyModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) // Vertical Combination Molecules From daeece0bbec664486a4cdba78c0594ef96f3e0e1 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 19 Feb 2020 16:39:45 +0530 Subject: [PATCH 02/12] Added contenthuggingpriority to avoid overlapping of labels. --- .../TwoColumn/ListTwoColumnPriceDetails.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift index 804918b2..e5c791eb 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -13,6 +13,7 @@ import Foundation let rightLabel = Label.commonLabelB2(true) let rightSubLabel = Label.commonLabelB2(true) let containerView = View() + let spaceBetweenleftLabelAndRightlabel: CGFloat = 40.0 // MARK: - MFViewProtocol open override func updateView(_ size: CGFloat) { @@ -40,9 +41,14 @@ import Foundation //leftLabel constraints leftLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true leftLabel.centerYAnchor.constraint(equalTo: rightLabel.centerYAnchor).isActive = true + leftLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 901), for: .horizontal) + leftLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 901), for: .horizontal) //rightLabel constraints + rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor, constant: spaceBetweenleftLabelAndRightlabel).isActive = true rightLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true rightLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true + rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 902), for: .horizontal) + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 902), for: .horizontal) //rightSubLabel constraints rightSubLabel.topAnchor.constraint(equalTo: rightLabel.bottomAnchor).isActive = true rightSubLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true From 212e61885231665d4ed2862fa74f76b6486d668d Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Thu, 20 Feb 2020 18:55:53 +0530 Subject: [PATCH 03/12] File changes --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 281a0672..898e1078 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -96,6 +96,8 @@ 0AE14F64238315D2005417F8 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE14F63238315D2005417F8 /* TextField.swift */; }; 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */; }; 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; }; + 522679EF23FEC02400906CBA /* ListTwoColumnPriceDetailsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679ED23FEC02300906CBA /* ListTwoColumnPriceDetailsModel.swift */; }; + 522679F023FEC02400906CBA /* ListTwoColumnPriceDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679EE23FEC02300906CBA /* ListTwoColumnPriceDetails.swift */; }; 5248BFEC23F12E350059236A /* ListThreeColumnPlanDataDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */; }; 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */; }; 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */; }; @@ -422,6 +424,8 @@ 0AE14F63238315D2005417F8 /* TextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = ""; }; 31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxLabelModel.swift; sourceTree = ""; }; 31BE15CA23D8924C00452370 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = ""; }; + 522679ED23FEC02300906CBA /* ListTwoColumnPriceDetailsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetailsModel.swift; sourceTree = ""; }; + 522679EE23FEC02300906CBA /* ListTwoColumnPriceDetails.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetails.swift; sourceTree = ""; }; 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDivider.swift; sourceTree = ""; }; 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDividerModel.swift; sourceTree = ""; }; 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaret.swift; sourceTree = ""; }; @@ -755,6 +759,15 @@ path = Views; sourceTree = ""; }; + 522679E823FEBD6D00906CBA /* TwoColumn */ = { + isa = PBXGroup; + children = ( + 522679EE23FEC02300906CBA /* ListTwoColumnPriceDetails.swift */, + 522679ED23FEC02300906CBA /* ListTwoColumnPriceDetailsModel.swift */, + ); + path = TwoColumn; + sourceTree = ""; + }; 946EE1B5237B663A0036751F /* Extensions */ = { isa = PBXGroup; children = ( @@ -994,6 +1007,7 @@ D22B38EC23F4E10700490EF6 /* SectionDividers */ = { isa = PBXGroup; children = ( + 522679E823FEBD6D00906CBA /* TwoColumn */, D22B38ED23F4E11100490EF6 /* ThreeColumn */, ); path = SectionDividers; @@ -1618,6 +1632,7 @@ 0A5D59C223AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift in Sources */, 943784F5236B77BB006A1E82 /* GraphView.swift in Sources */, 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */, + 522679EF23FEC02400906CBA /* ListTwoColumnPriceDetailsModel.swift in Sources */, 94C661DA23CCF4FB00D9FE5B /* UIColor+Extension.swift in Sources */, D29DF32121ED0CBA003B2FB9 /* LabelView.m in Sources */, D28A838123CCB0D800DFE4FC /* AccordionListItemModel.swift in Sources */, @@ -1731,6 +1746,7 @@ 0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */, D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */, + 522679F023FEC02400906CBA /* ListTwoColumnPriceDetails.swift in Sources */, D2B18B94236214AD00A9AEDC /* NavigationController.swift in Sources */, D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */, D282AACB2243C61700C46919 /* ButtonView.swift in Sources */, From 607959bd1bf5b3577b871eb47387b189bc75d248 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Thu, 20 Feb 2020 19:35:45 +0530 Subject: [PATCH 04/12] Constraint changes. --- .../TwoColumn/ListTwoColumnPriceDetails.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift index e5c791eb..5b3a27df 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -26,21 +26,20 @@ import Foundation open override func setupView() { super.setupView() - guard leftLabel.superview == nil else { return } containerView.translatesAutoresizingMaskIntoConstraints = false - contentView.addSubview(containerView) containerView.addSubview(leftLabel) containerView.addSubview(rightLabel) containerView.addSubview(rightSubLabel) - + contentView.addSubview(containerView) //containerView constraints containerHelper.constrainView(containerView) + //leftLabel constraints leftLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true - leftLabel.centerYAnchor.constraint(equalTo: rightLabel.centerYAnchor).isActive = true + leftLabel.topAnchor.constraint(equalTo: rightLabel.topAnchor).isActive = true leftLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 901), for: .horizontal) leftLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 901), for: .horizontal) //rightLabel constraints From b08db78d099fa64da6ec7ccc0fa313ef86465d8d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Mon, 24 Feb 2020 11:46:44 +0530 Subject: [PATCH 05/12] Added constraints. --- .../TwoColumn/ListTwoColumnPriceDetails.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift index 5b3a27df..ae83dff3 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -40,8 +40,7 @@ import Foundation //leftLabel constraints leftLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true leftLabel.topAnchor.constraint(equalTo: rightLabel.topAnchor).isActive = true - leftLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 901), for: .horizontal) - leftLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 901), for: .horizontal) + containerView.bottomAnchor.constraint(equalTo: leftLabel.bottomAnchor).isActive = true //rightLabel constraints rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor, constant: spaceBetweenleftLabelAndRightlabel).isActive = true rightLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true @@ -51,7 +50,7 @@ import Foundation //rightSubLabel constraints rightSubLabel.topAnchor.constraint(equalTo: rightLabel.bottomAnchor).isActive = true rightSubLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true - containerView.bottomAnchor.constraint(equalTo: rightSubLabel.bottomAnchor).isActive = true + containerView.bottomAnchor.constraint(greaterThanOrEqualTo: rightSubLabel.bottomAnchor).isActive = true } // MARK: - MVMCoreUIMoleculeViewProtocol From 7c4401f4acd84d6a5b6e57809466f0cc2b0ece84 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Thu, 27 Feb 2020 14:30:56 +0530 Subject: [PATCH 06/12] referencing error --- .../TwoColumn/ListTwoColumnPriceDetails.swift | 75 ------------------- .../ListTwoColumnPriceDetailsModel.swift | 47 ------------ 2 files changed, 122 deletions(-) delete mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift delete mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift deleted file mode 100644 index ae83dff3..00000000 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// ListTwoColumnPriceDetails.swift -// MVMCoreUI -// -// Created by Lekshmi S on 19/02/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation -@objcMembers open class ListTwoColumnPriceDetails: TableViewCell { - - let leftLabel = Label.commonLabelB2(true) - let rightLabel = Label.commonLabelB2(true) - let rightSubLabel = Label.commonLabelB2(true) - let containerView = View() - let spaceBetweenleftLabelAndRightlabel: CGFloat = 40.0 - - // MARK: - MFViewProtocol - open override func updateView(_ size: CGFloat) { - super.updateView(size) - containerView.updateView(size) - leftLabel.updateView(size) - rightLabel.updateView(size) - rightSubLabel.updateView(size) - } - - open override func setupView() { - super.setupView() - guard leftLabel.superview == nil else { - return - } - containerView.translatesAutoresizingMaskIntoConstraints = false - containerView.addSubview(leftLabel) - containerView.addSubview(rightLabel) - containerView.addSubview(rightSubLabel) - contentView.addSubview(containerView) - //containerView constraints - containerHelper.constrainView(containerView) - - //leftLabel constraints - leftLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true - leftLabel.topAnchor.constraint(equalTo: rightLabel.topAnchor).isActive = true - containerView.bottomAnchor.constraint(equalTo: leftLabel.bottomAnchor).isActive = true - //rightLabel constraints - rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor, constant: spaceBetweenleftLabelAndRightlabel).isActive = true - rightLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true - rightLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true - rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 902), for: .horizontal) - rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 902), for: .horizontal) - //rightSubLabel constraints - rightSubLabel.topAnchor.constraint(equalTo: rightLabel.bottomAnchor).isActive = true - rightSubLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true - containerView.bottomAnchor.constraint(greaterThanOrEqualTo: rightSubLabel.bottomAnchor).isActive = true - } - - // MARK: - MVMCoreUIMoleculeViewProtocol - public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { - super.setWithModel(model, delegateObject, additionalData) - guard let model = model as? ListTwoColumnPriceDetailsModel else { return } - leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData) - rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) - rightSubLabel.setWithModel(model.rightSubLabel, delegateObject, additionalData) - } - - open override func reset() { - super.reset() - leftLabel.reset() - rightLabel.reset() - rightSubLabel.reset() - } - - public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { - return 60 - } -} diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift deleted file mode 100644 index 52bf3e10..00000000 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// ListTwoColumnPriceDetailsModel.swift -// MVMCoreUI -// -// Created by Lekshmi S on 19/02/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol { - public static var identifier: String = "list2CTxtPrc2" - public var leftLabel: LabelModel - public var rightLabel: LabelModel - public var rightSubLabel: LabelModel - - public init(leftLabel: LabelModel, rightLabel:LabelModel, rightSubLabel: LabelModel) { - self.leftLabel = leftLabel - self.rightLabel = rightLabel - self.rightSubLabel = rightSubLabel - super.init() - } - - private enum CodingKeys: String, CodingKey { - case moleculeName - case leftLabel - case rightLabel - case rightSubLabel - } - - 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) - rightSubLabel = try typeContainer.decode(LabelModel.self, forKey: .rightSubLabel) - 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(rightSubLabel, forKey: .rightSubLabel) - } -} From d507e66d13b300b4d6347066b41817cde864bd82 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Thu, 27 Feb 2020 19:06:49 +0530 Subject: [PATCH 07/12] Added ListTwoCloumnPriceDetails molecule --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++++++ .../TwoColumn/ListTwoColumnPriceDetails.swift | 55 +++++++++++++++++++ .../ListTwoColumnPriceDetailsModel.swift | 47 ++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 119 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 95bd45b6..873d694f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -101,6 +101,8 @@ 52267A0723FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */; }; 5248BFEC23F12E350059236A /* ListThreeColumnPlanDataDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */; }; 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */; }; + 525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */; }; + 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.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 */; }; @@ -435,6 +437,8 @@ 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinks.swift; sourceTree = ""; }; 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDivider.swift; sourceTree = ""; }; 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListThreeColumnPlanDataDividerModel.swift; sourceTree = ""; }; + 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetailsModel.swift; sourceTree = ""; }; + 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetails.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 = ""; }; @@ -781,6 +785,15 @@ path = OneColumn; sourceTree = ""; }; + 525239BE2407BCE500454969 /* TwoColumn */ = { + isa = PBXGroup; + children = ( + 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */, + 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */, + ); + path = TwoColumn; + sourceTree = ""; + }; 946EE1B5237B663A0036751F /* Extensions */ = { isa = PBXGroup; children = ( @@ -1024,6 +1037,7 @@ D22B38EC23F4E10700490EF6 /* SectionDividers */ = { isa = PBXGroup; children = ( + 525239BE2407BCE500454969 /* TwoColumn */, 52267A0523FFE0A900906CBA /* OneColumn */, D22B38ED23F4E11100490EF6 /* ThreeColumn */, ); @@ -1716,6 +1730,7 @@ 012A88C4238D86E600FE3DA1 /* CarouselItemModelProtocol.swift in Sources */, D2E2A9A123E095AB000B42E6 /* ButtonModelProtocol.swift in Sources */, 94C2D9AB23872EB50006CF46 /* LabelAttributeActionModel.swift in Sources */, + 525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */, D2E2A99A23D8D6B4000B42E6 /* HeadlineBodyButtonModel.swift in Sources */, 014AA73123C5059B006F3E93 /* ListPageTemplateModel.swift in Sources */, 017BEB4023620A230024EF95 /* TextFieldModel.swift in Sources */, @@ -1860,6 +1875,7 @@ D29DF2AA21E7B2F9003B2FB9 /* MVMCoreUIConstants.m in Sources */, 948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */, 013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */, + 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */, D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */, D2E2A9A323E096B1000B42E6 /* DisableableModelProtocol.swift in Sources */, D29DF11821E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.m in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift new file mode 100644 index 00000000..0a84a97c --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -0,0 +1,55 @@ +// +// ListTwoColumnPriceDetails.swift +// MVMCoreUI +// +// Created by Lekshmi S on 19/02/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import UIKit + +@objcMembers open class ListTwoColumnPriceDetails: TableViewCell { + + let leftLabel = Label.commonLabelB2(true) + let rightLabel = Label.commonLabelB2(true) + let rightSubLabel = Label.commonLabelB2(true) + let containerView = View() + let verticalStack = UIStackView() + + // MARK: - MFViewProtocol + open override func setupView() { + super.setupView() + + rightLabel.numberOfLines = 1 + rightSubLabel.numberOfLines = 1 + verticalStack.translatesAutoresizingMaskIntoConstraints = false + containerView.addSubview(leftLabel) + verticalStack.addArrangedSubview(rightLabel) + verticalStack.addArrangedSubview(rightSubLabel) + verticalStack.axis = .vertical + verticalStack.alignment = .trailing + containerView.addSubview(verticalStack) + addMolecule(containerView) + NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: verticalStack, alignTop: true) + } + + // MARK: - MVMCoreUIMoleculeViewProtocol + open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.setWithModel(model, delegateObject, additionalData) + guard let model = model as? ListTwoColumnPriceDetailsModel else { return } + leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData) + rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) + rightSubLabel.setWithModel(model.rightSubLabel, delegateObject, additionalData) + } + + open override func reset() { + super.reset() + leftLabel.styleB2(true) + rightLabel.styleB2(true) + rightSubLabel.styleB2(true) + } + + open override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 90 + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift new file mode 100644 index 00000000..52bf3e10 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift @@ -0,0 +1,47 @@ +// +// ListTwoColumnPriceDetailsModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 19/02/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol { + public static var identifier: String = "list2CTxtPrc2" + public var leftLabel: LabelModel + public var rightLabel: LabelModel + public var rightSubLabel: LabelModel + + public init(leftLabel: LabelModel, rightLabel:LabelModel, rightSubLabel: LabelModel) { + self.leftLabel = leftLabel + self.rightLabel = rightLabel + self.rightSubLabel = rightSubLabel + super.init() + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case leftLabel + case rightLabel + case rightSubLabel + } + + 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) + rightSubLabel = try typeContainer.decode(LabelModel.self, forKey: .rightSubLabel) + 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(rightSubLabel, forKey: .rightSubLabel) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 30efb2f7..42b93a12 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -55,6 +55,7 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: StringAndMoleculeView.self, viewModelClass: StringAndMoleculeModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ImageHeadlineBody.self, viewModelClass: ImageHeadlineBodyModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) From f21cac7a41a95b8fc99dc478d938cd36fed040ce Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 3 Mar 2020 16:06:04 +0530 Subject: [PATCH 08/12] Code cleanup --- .../TwoColumn/ListTwoColumnPriceDetails.swift | 12 ++++++------ .../TwoColumn/ListTwoColumnPriceDetailsModel.swift | 6 ++++++ MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift index 0a84a97c..8b033f27 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -34,12 +34,12 @@ import UIKit } // MARK: - MVMCoreUIMoleculeViewProtocol - open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { - super.setWithModel(model, delegateObject, additionalData) + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) guard let model = model as? ListTwoColumnPriceDetailsModel else { return } - leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData) - rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData) - rightSubLabel.setWithModel(model.rightSubLabel, delegateObject, additionalData) + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + rightSubLabel.set(with: model.rightSubLabel, delegateObject, additionalData) } open override func reset() { @@ -49,7 +49,7 @@ import UIKit rightSubLabel.styleB2(true) } - open override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { return 90 } } diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift index 52bf3e10..78665414 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift @@ -21,6 +21,12 @@ public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtoco super.init() } + /// Defaults to set + override public func setDefaults() { + super.setDefaults() + style = "none" + } + private enum CodingKeys: String, CodingKey { case moleculeName case leftLabel diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 34da2080..ae66ae13 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -107,6 +107,7 @@ import Foundation // 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: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) // TODO: Need model MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString) From a16855527f99841a4071490e1877dbf76b4d2bca Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 11 Mar 2020 16:21:52 +0530 Subject: [PATCH 09/12] Resolved merge conflicts. --- MVMCoreUI.xcodeproj/project.pbxproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index b6657933..fcc5da40 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -846,7 +846,6 @@ path = FourColumn; sourceTree = ""; }; - 525239C32407FFCC00454969 /* LockUps */ = { 525239BE2407BCE500454969 /* TwoColumn */ = { isa = PBXGroup; children = ( @@ -856,7 +855,7 @@ path = TwoColumn; sourceTree = ""; }; - 946EE1B5237B663A0036751F /* Extensions */ = { + 525239C32407FFCC00454969 /* LockUps */ = { isa = PBXGroup; children = ( 525019DB2406430700EED91C /* ListProgressBarDataModel.swift */, From f33fd320ad26310c4f0acd0c24a62758d3ae54c2 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 11 Mar 2020 16:22:48 +0530 Subject: [PATCH 10/12] Refactored code as per the changes in confluence. --- .../TwoColumn/ListTwoColumnPriceDetails.swift | 30 ++++++++----------- .../ListTwoColumnPriceDetailsModel.swift | 7 +---- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift index 8b033f27..2d9051d7 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -12,25 +12,23 @@ import UIKit let leftLabel = Label.commonLabelB2(true) let rightLabel = Label.commonLabelB2(true) - let rightSubLabel = Label.commonLabelB2(true) - let containerView = View() - let verticalStack = UIStackView() + var stack: Stack + // MARK: - Initializers + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 70, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .trailing))], axis: .horizontal) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + // MARK: - MFViewProtocol open override func setupView() { super.setupView() - - rightLabel.numberOfLines = 1 - rightSubLabel.numberOfLines = 1 - verticalStack.translatesAutoresizingMaskIntoConstraints = false - containerView.addSubview(leftLabel) - verticalStack.addArrangedSubview(rightLabel) - verticalStack.addArrangedSubview(rightSubLabel) - verticalStack.axis = .vertical - verticalStack.alignment = .trailing - containerView.addSubview(verticalStack) - addMolecule(containerView) - NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: verticalStack, alignTop: true) + addMolecule(stack) + stack.restack() } // MARK: - MVMCoreUIMoleculeViewProtocol @@ -39,14 +37,12 @@ import UIKit guard let model = model as? ListTwoColumnPriceDetailsModel else { return } leftLabel.set(with: model.leftLabel, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) - rightSubLabel.set(with: model.rightSubLabel, delegateObject, additionalData) } open override func reset() { super.reset() leftLabel.styleB2(true) rightLabel.styleB2(true) - rightSubLabel.styleB2(true) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift index 78665414..cd5b5d54 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetailsModel.swift @@ -12,12 +12,10 @@ public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtoco public static var identifier: String = "list2CTxtPrc2" public var leftLabel: LabelModel public var rightLabel: LabelModel - public var rightSubLabel: LabelModel - public init(leftLabel: LabelModel, rightLabel:LabelModel, rightSubLabel: LabelModel) { + public init(leftLabel: LabelModel, rightLabel:LabelModel) { self.leftLabel = leftLabel self.rightLabel = rightLabel - self.rightSubLabel = rightSubLabel super.init() } @@ -31,14 +29,12 @@ public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtoco case moleculeName case leftLabel case rightLabel - case rightSubLabel } 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) - rightSubLabel = try typeContainer.decode(LabelModel.self, forKey: .rightSubLabel) try super.init(from: decoder) } @@ -48,6 +44,5 @@ public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtoco try container.encode(moleculeName, forKey: .moleculeName) try container.encode(leftLabel, forKey: .leftLabel) try container.encode(rightLabel, forKey: .rightLabel) - try container.encode(rightSubLabel, forKey: .rightSubLabel) } } From cf9fe4f3e8cd437f3acc6e2a709e27e823beafcc Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 12 Mar 2020 10:48:37 +0530 Subject: [PATCH 11/12] Removed extra space. --- .../SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift index 2d9051d7..96b076d1 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnPriceDetails.swift @@ -10,7 +10,7 @@ import UIKit @objcMembers open class ListTwoColumnPriceDetails: TableViewCell { - let leftLabel = Label.commonLabelB2(true) + let leftLabel = Label.commonLabelB2(true) let rightLabel = Label.commonLabelB2(true) var stack: Stack From 54a12804a51504f24a75d32d960ecc71f4d5678e Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 16 Mar 2020 12:52:59 -0400 Subject: [PATCH 12/12] Minor changes for testing --- MVMCoreUI.xcodeproj/project.pbxproj | 39 +++++++++++-------- .../TwoColumn/ListTwoColumnPriceDetails.swift | 30 +++++++------- .../ListTwoColumnPriceDetailsModel.swift | 6 +++ 3 files changed, 45 insertions(+), 30 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 694868a6..eeb7a82e 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -121,14 +121,14 @@ 525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019DC2406430800EED91C /* ListProgressBarData.swift */; }; 525019E52406852100EED91C /* ListFourColumnDataUsageDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E42406852100EED91C /* ListFourColumnDataUsageDividerModel.swift */; }; 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */; }; + 525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */; }; + 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */; }; 526A265C240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */; }; 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 */; }; 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */; }; 8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */; }; - 525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */; }; - 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.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 */; }; @@ -491,14 +491,14 @@ 525019DC2406430800EED91C /* ListProgressBarData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarData.swift; sourceTree = ""; }; 525019E42406852100EED91C /* ListFourColumnDataUsageDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDividerModel.swift; sourceTree = ""; }; 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDivider.swift; sourceTree = ""; }; + 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetailsModel.swift; sourceTree = ""; }; + 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetails.swift; sourceTree = ""; }; 526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnCompareChangesModel.swift; sourceTree = ""; }; 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 = ""; }; 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyTextModel.swift; sourceTree = ""; }; 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyText.swift; sourceTree = ""; }; - 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetailsModel.swift; sourceTree = ""; }; - 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetails.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 = ""; }; @@ -893,17 +893,6 @@ path = FourColumn; sourceTree = ""; }; - 526A265A240D1FCE00B0D828 /* TwoColumn */ = { - isa = PBXGroup; - children = ( - 526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */, - 526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */, - 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */, - 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */, - ); - path = TwoColumn; - sourceTree = ""; - }; 525239C32407FFCC00454969 /* LockUps */ = { isa = PBXGroup; children = ( @@ -913,6 +902,13 @@ path = LockUps; sourceTree = ""; }; + 526A265A240D1FCE00B0D828 /* TwoColumn */ = { + isa = PBXGroup; + children = ( + ); + path = TwoColumn; + sourceTree = ""; + }; 94C2D9822386F3E30006CF46 /* Label */ = { isa = PBXGroup; children = ( @@ -1129,6 +1125,7 @@ D22B38EA23F4E08B00490EF6 /* List */ = { isa = PBXGroup; children = ( + D22D8396241FDE4700D3DF69 /* TwoColumn */, 52267A0523FFE0A900906CBA /* OneColumn */, AA4FC2A323F4F69600E251DB /* RightVariable */, D22B38EB23F4E0AE00490EF6 /* LeftVariable */, @@ -1154,7 +1151,6 @@ children = ( 526A265A240D1FCE00B0D828 /* TwoColumn */, 525019E3240684E500EED91C /* FourColumn */, - 52267A0523FFE0A900906CBA /* OneColumn */, D22B38ED23F4E11100490EF6 /* ThreeColumn */, ); path = SectionDividers; @@ -1178,6 +1174,17 @@ path = Legacy; sourceTree = ""; }; + D22D8396241FDE4700D3DF69 /* TwoColumn */ = { + isa = PBXGroup; + children = ( + 526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */, + 526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */, + 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */, + 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */, + ); + path = TwoColumn; + sourceTree = ""; + }; D260105723CF9CC500764D80 /* Doughnut */ = { isa = PBXGroup; children = ( diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift index 96b076d1..6582d820 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift @@ -12,23 +12,23 @@ import UIKit let leftLabel = Label.commonLabelB2(true) let rightLabel = Label.commonLabelB2(true) - var stack: Stack + let view = MVMCoreUICommonViewsUtility.commonView() - // MARK: - Initializers - public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 70, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .trailing))], axis: .horizontal) - super.init(style: style, reuseIdentifier: reuseIdentifier) - } - - public required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - // MARK: - MFViewProtocol open override func setupView() { super.setupView() - addMolecule(stack) - stack.restack() + view.addSubview(leftLabel) + view.addSubview(rightLabel) + NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: true) + contentView.addSubview(view) + containerHelper.constrainView(view) + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) + } + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + leftLabel.updateView(size) + rightLabel.updateView(size) } // MARK: - MVMCoreUIMoleculeViewProtocol @@ -41,11 +41,13 @@ import UIKit open override func reset() { super.reset() + leftLabel.reset() + rightLabel.reset() leftLabel.styleB2(true) rightLabel.styleB2(true) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { - return 90 + return 15 } } diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetailsModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetailsModel.swift index cd5b5d54..2de46552 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetailsModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetailsModel.swift @@ -23,6 +23,12 @@ public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtoco override public func setDefaults() { super.setDefaults() style = "none" + if leftLabel.textColor == nil { + leftLabel.textColor = Color(uiColor: .mvmCoolGray6) + } + if rightLabel.textColor == nil { + rightLabel.textColor = Color(uiColor: .mvmCoolGray6) + } } private enum CodingKeys: String, CodingKey {