From 8e4d42e67be35c65008c7e8574fae1cdbe1eec7f Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 20 Mar 2020 17:41:08 +0530 Subject: [PATCH 01/25] 19180(List - Three Column - Speed Test - Divider) story initial commit Added model class and molecule class. --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ .../ListThreeColumnSpeedTestDivider.swift | 63 +++++++++++++++++++ ...ListThreeColumnSpeedTestDividerModel.swift | 53 ++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 125 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f17d7906..b9510660 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -175,6 +175,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 */; }; + AA72AF172424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA72AF162424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift */; }; + AA72AF192424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA72AF182424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.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 */; }; @@ -559,6 +561,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 = ""; }; + AA72AF162424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDivider.swift; sourceTree = ""; }; + AA72AF182424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.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 = ""; }; @@ -1227,6 +1231,8 @@ children = ( 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */, 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */, + AA72AF162424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift */, + AA72AF182424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift */, ); path = ThreeColumn; sourceTree = ""; @@ -2082,6 +2088,7 @@ 0AE98BB523FF18D2004C5109 /* Arrow.swift in Sources */, D2D90B442404789000DD6EC9 /* MoleculeContainerProtocol.swift in Sources */, 94C0150A24215643005811A9 /* ActionTopAlertModel.swift in Sources */, + AA72AF172424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift in Sources */, 012A88DB238ED45900FE3DA1 /* CarouselModel.swift in Sources */, D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */, 0AE14F64238315D2005417F8 /* TextField.swift in Sources */, @@ -2116,6 +2123,7 @@ D26C5A6B23F4A40D007AEECE /* ListItemModel.swift in Sources */, 0A21DB8D235E06EF00C160A2 /* MFDigitTextField.m in Sources */, 94AF4A4323E9D19E00676048 /* MFCaretView.m in Sources */, + AA72AF192424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */, 943784F6236B77BB006A1E82 /* GraphViewAnimationHandler.swift in Sources */, 011D95A1240453D0000E3791 /* RuleEqualsModel.swift in Sources */, D29DF2AA21E7B2F9003B2FB9 /* MVMCoreUIConstants.m in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift new file mode 100644 index 00000000..b278185d --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift @@ -0,0 +1,63 @@ +// +// ListThreeColumnSpeedTestDivider.swift +// MVMCoreUI +// +// Created by Lekshmi S on 20/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ListThreeColumnSpeedTestDivider: TableViewCell { + + //------------------------------------------------------- + // MARK: - Outlets + //------------------------------------------------------- + let leftLabel = Label.createLabelBoldBodySmall(true) + let centerLabel = Label.createLabelBoldBodySmall(true) + let rightLabel = Label.createLabelBoldBodySmall(true) + var stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], axis: .horizontal, spacing: 8) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + addMolecule(stack) + stack.restack() + } + + //------------------------------------------------------ + // 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? ListThreeColumnSpeedTestDividerModel else { return } + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + centerLabel.set(with: model.centerLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 121 + } + + open override func reset() { + super.reset() + leftLabel.styleBoldBodySmall(true) + centerLabel.styleBoldBodySmall(true) + rightLabel.styleBoldBodySmall(true) + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift new file mode 100644 index 00000000..44f697ad --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift @@ -0,0 +1,53 @@ +// +// ListThreeColumnSpeedTestDividerModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 20/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListThreeColumnSpeedTestDividerModel: ListItemModel, MoleculeModelProtocol { + public static var identifier: String = "list3CSpdTstDiv" + public var leftLabel: LabelModel + public var centerLabel: LabelModel + public var rightLabel: LabelModel + + public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) { + self.leftLabel = leftLabel + self.centerLabel = centerLabel + self.rightLabel = rightLabel + super.init() + } + + /// Defaults to set + override public func setDefaults() { + super.setDefaults() + style = "tallDivider" + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case leftLabel + case centerLabel + case rightLabel + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) + centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel) + rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) + 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(centerLabel, forKey: .centerLabel) + try container.encode(rightLabel, forKey: .rightLabel) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index f2bf9e78..a364e216 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -117,6 +117,7 @@ import Foundation 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) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnSpeedTestDivider.self, viewModelClass: ListThreeColumnSpeedTestDividerModel.self) // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) From 2226d9beed2b38bb41bcc581d51d436cd82950cd Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Tue, 24 Mar 2020 10:37:48 +0530 Subject: [PATCH 02/25] 190780 - List- Three Column - International Data Divider - Initial commit --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ ...tThreeColumnInternationalDataDivider.swift | 67 +++++++++++++++++++ ...eColumnInternationalDataDividerModel.swift | 52 ++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 128 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f17d7906..06f3740f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -134,6 +134,8 @@ 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 */; }; + 8DFBDE1D24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFBDE1C24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift */; }; + 8DFBDE1F24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFBDE1E24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift */; }; 942C372E241149170066E45E /* NHaasGroteskDSStd-75Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372C241149170066E45E /* NHaasGroteskDSStd-75Bd.otf */; }; 942C372F241149170066E45E /* NHaasGroteskDSStd-55Rg.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372D241149170066E45E /* NHaasGroteskDSStd-55Rg.otf */; }; 942C378C2412F4FA0066E45E /* ModalMoleculeListTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 942C378B2412F4FA0066E45E /* ModalMoleculeListTemplate.swift */; }; @@ -519,6 +521,8 @@ 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 = ""; }; + 8DFBDE1C24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalDataDividerModel.swift; sourceTree = ""; }; + 8DFBDE1E24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalDataDivider.swift; sourceTree = ""; }; 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftRightLabelModel.swift; sourceTree = ""; }; 942C372C241149170066E45E /* NHaasGroteskDSStd-75Bd.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-75Bd.otf"; sourceTree = ""; }; 942C372D241149170066E45E /* NHaasGroteskDSStd-55Rg.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-55Rg.otf"; sourceTree = ""; }; @@ -1227,6 +1231,8 @@ children = ( 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */, 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */, + 8DFBDE1C24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift */, + 8DFBDE1E24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift */, ); path = ThreeColumn; sourceTree = ""; @@ -1909,6 +1915,7 @@ BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */, 012A88C8238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift in Sources */, 0A7EF86123D8AC2500B2AAD1 /* DigitEntryFieldModel.swift in Sources */, + 8DFBDE1D24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift in Sources */, DBC4392122491730001AB423 /* LabelWithInternalButton.swift in Sources */, D224798C231450C8003FCCF9 /* HeadlineBodyToggle.swift in Sources */, 017BEB442362192F0024EF95 /* MVMCoreUIMoleculeMappingObject+ModelExtension.swift in Sources */, @@ -2123,6 +2130,7 @@ 948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */, 013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */, 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */, + 8DFBDE1F24288965007F3433 /* ListThreeColumnInternationalDataDivider.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/ThreeColumn/ListThreeColumnInternationalDataDivider.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift new file mode 100644 index 00000000..60977ef1 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift @@ -0,0 +1,67 @@ +// +// ListThreeColumnInternationalDataDivider.swift +// MVMCoreUI +// +// Created by Kruthika KP on 23/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ListThreeColumnInternationalDataDivider: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + let leftLabel = Label.createLabelBoldBodySmall(true) + let centerLabel = Label.createLabelBoldBodySmall(true) + let rightLabel = Label.createLabelBoldBodySmall(true) + var stack: Stack + + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), + (view: centerLabel, model: StackItemModel(percent: 34, horizontalAlignment: .leading)), + (view: rightLabel, model: StackItemModel(percent: 33, horizontalAlignment: .center))], + 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() + } + + //----------------------------------------------------- + // MARK: - ModelMoleculeViewProtocol + //----------------------------------------------------- + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListThreeColumnInternationalDataDividerModel else { return } + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + centerLabel.set(with: model.centerLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 121 + } + + //----------------------------------------------------- + // MARK: - MVMCoreUIMoleculeViewProtocol + //----------------------------------------------------- + override open func reset() { + super.reset() + leftLabel.styleBoldBodySmall(true) + centerLabel.styleBoldBodySmall(true) + rightLabel.styleBoldBodySmall(true) + } +} + diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift new file mode 100644 index 00000000..19d71073 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift @@ -0,0 +1,52 @@ +// +// ListThreeColumnInternationalDataDividerModel.swift +// MVMCoreUI +// +// Created by Kruthika KP on 23/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListThreeColumnInternationalDataDividerModel : ListItemModel, MoleculeModelProtocol { + public static var identifier: String = "list3CIntDataDiv" + public var leftLabel: LabelModel + public var centerLabel: LabelModel + public var rightLabel: LabelModel + + public init (leftLabel:LabelModel, centerLabel:LabelModel, rightLabel:LabelModel) { + self.leftLabel = leftLabel + self.centerLabel = centerLabel + self.rightLabel = rightLabel + super.init() + } + + override public func setDefaults() { + super.setDefaults() + style = "tallDivider" + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case leftLabel + case centerLabel + case rightLabel + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) + centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel) + rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) + 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(centerLabel, forKey: .centerLabel) + try container.encode(rightLabel, forKey: .rightLabel) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index f2bf9e78..7bda1e5f 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -117,6 +117,7 @@ import Foundation 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) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnInternationalDataDivider.self, viewModelClass: ListThreeColumnInternationalDataDividerModel.self) // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) From 95d705abb48ec48e7a8e02d6a2bc37e38a25ab01 Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Tue, 24 Mar 2020 17:02:29 +0530 Subject: [PATCH 03/25] 19078 - List - Three Column - International Data - Updated to latest --- MVMCoreUI.xcodeproj/project.pbxproj | 25 +++++--- .../ListThreeColumnInternationalData.swift} | 59 ++++++++++--------- ...stThreeColumnInternationalDataModel.swift} | 25 +++++--- .../OtherHandlers/MoleculeObjectMapping.swift | 2 +- 4 files changed, 65 insertions(+), 46 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift => List/ThreeColumn/ListThreeColumnInternationalData.swift} (58%) rename MVMCoreUI/Molecules/DesignedComponents/{SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift => List/ThreeColumn/ListThreeColumnInternationalDataModel.swift} (62%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 06f3740f..a1bf3ac2 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -134,8 +134,8 @@ 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 */; }; - 8DFBDE1D24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFBDE1C24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift */; }; - 8DFBDE1F24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFBDE1E24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift */; }; + 8DFB6D8B242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFB6D8A242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift */; }; + 8DFB6D8D242A138000A3F715 /* ListThreeColumnInternationalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFB6D8C242A138000A3F715 /* ListThreeColumnInternationalData.swift */; }; 942C372E241149170066E45E /* NHaasGroteskDSStd-75Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372C241149170066E45E /* NHaasGroteskDSStd-75Bd.otf */; }; 942C372F241149170066E45E /* NHaasGroteskDSStd-55Rg.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372D241149170066E45E /* NHaasGroteskDSStd-55Rg.otf */; }; 942C378C2412F4FA0066E45E /* ModalMoleculeListTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 942C378B2412F4FA0066E45E /* ModalMoleculeListTemplate.swift */; }; @@ -521,8 +521,8 @@ 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 = ""; }; - 8DFBDE1C24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalDataDividerModel.swift; sourceTree = ""; }; - 8DFBDE1E24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalDataDivider.swift; sourceTree = ""; }; + 8DFB6D8A242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalDataModel.swift; sourceTree = ""; }; + 8DFB6D8C242A138000A3F715 /* ListThreeColumnInternationalData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalData.swift; sourceTree = ""; }; 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftRightLabelModel.swift; sourceTree = ""; }; 942C372C241149170066E45E /* NHaasGroteskDSStd-75Bd.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-75Bd.otf"; sourceTree = ""; }; 942C372D241149170066E45E /* NHaasGroteskDSStd-55Rg.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-55Rg.otf"; sourceTree = ""; }; @@ -923,6 +923,7 @@ 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */, 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */, 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */, + 8DFB6D89242A134600A3F715 /* ThreeColumn */, ); path = OneColumn; sourceTree = ""; @@ -965,6 +966,16 @@ path = TwoColumn; sourceTree = ""; }; + 8DFB6D89242A134600A3F715 /* ThreeColumn */ = { + isa = PBXGroup; + children = ( + 8DFB6D8A242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift */, + 8DFB6D8C242A138000A3F715 /* ListThreeColumnInternationalData.swift */, + ); + name = ThreeColumn; + path = ../ThreeColumn; + sourceTree = ""; + }; 94C01508242155FE005811A9 /* Actions */ = { isa = PBXGroup; children = ( @@ -1231,8 +1242,6 @@ children = ( 5248BFEB23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift */, 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */, - 8DFBDE1C24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift */, - 8DFBDE1E24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift */, ); path = ThreeColumn; sourceTree = ""; @@ -1884,6 +1893,7 @@ D28A838123CCB0D800DFE4FC /* AccordionListItemModel.swift in Sources */, DBC4391822442197001AB423 /* CaretView.swift in Sources */, C07065C42395677300FBF997 /* Link.swift in Sources */, + 8DFB6D8D242A138000A3F715 /* ListThreeColumnInternationalData.swift in Sources */, 0A69F611241BDEA700F7231B /* RuleAnyRequiredModel.swift in Sources */, D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */, D29B771022C281F400D6ACE0 /* ModuleMolecule.swift in Sources */, @@ -1915,7 +1925,6 @@ BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */, 012A88C8238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift in Sources */, 0A7EF86123D8AC2500B2AAD1 /* DigitEntryFieldModel.swift in Sources */, - 8DFBDE1D24288958007F3433 /* ListThreeColumnInternationalDataDividerModel.swift in Sources */, DBC4392122491730001AB423 /* LabelWithInternalButton.swift in Sources */, D224798C231450C8003FCCF9 /* HeadlineBodyToggle.swift in Sources */, 017BEB442362192F0024EF95 /* MVMCoreUIMoleculeMappingObject+ModelExtension.swift in Sources */, @@ -2130,7 +2139,6 @@ 948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */, 013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */, 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */, - 8DFBDE1F24288965007F3433 /* ListThreeColumnInternationalDataDivider.swift in Sources */, D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */, D2E2A9A323E096B1000B42E6 /* DisableableModelProtocol.swift in Sources */, D29DF11821E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.m in Sources */, @@ -2157,6 +2165,7 @@ D2B18B922361E65A00A9AEDC /* CoreUIObject.swift in Sources */, D29DF2BE21E7BEA4003B2FB9 /* TopTabbar.m in Sources */, 014AA72E23C5059B006F3E93 /* StackCenteredPageTemplateModel.swift in Sources */, + 8DFB6D8B242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift in Sources */, D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */, 011D959D2404536F000E3791 /* RuleAnyValueChangedModel.swift in Sources */, D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift b/MVMCoreUI/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift similarity index 58% rename from MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift rename to MVMCoreUI/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift index 60977ef1..948bdb9b 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift @@ -1,28 +1,34 @@ // -// ListThreeColumnInternationalDataDivider.swift +// ListThreeColumnInternationalData.swift // MVMCoreUI // -// Created by Kruthika KP on 23/03/20. +// Created by Kruthika KP on 24/03/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // import Foundation -@objcMembers open class ListThreeColumnInternationalDataDivider: TableViewCell { + +@objcMembers public class ListThreeColumnInternationalData: TableViewCell { //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - let leftLabel = Label.createLabelBoldBodySmall(true) - let centerLabel = Label.createLabelBoldBodySmall(true) - let rightLabel = Label.createLabelBoldBodySmall(true) var stack: Stack + let leftLabel = Label.createLabelRegularBodySmall(true) + let centerLabel = Label.createLabelRegularBodySmall(true) + let rightLabel = Label.createLabelRegularBodySmall(true) + let arrow = Arrow(frame: .zero) + //----------------------------------------------------- + // MARK: - Initializers + //----------------------------------------------------- public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), - (view: centerLabel, model: StackItemModel(percent: 34, horizontalAlignment: .leading)), - (view: rightLabel, model: StackItemModel(percent: 33, horizontalAlignment: .center))], - axis: .horizontal) + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading)), + (view: arrow, model: StackItemModel(percent: 4, horizontalAlignment: .trailing)), + (view: centerLabel, model: StackItemModel(percent: 46, horizontalAlignment: .leading)), + (view: rightLabel, model: StackItemModel(percent:30,horizontalAlignment: .center))], + axis: .horizontal,spacing: 2) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -31,37 +37,34 @@ import Foundation } //----------------------------------------------------- - // MARK: - MFViewProtocol + // MARK: - View Lifecycle //----------------------------------------------------- - open override func setupView() { + override open func setupView() { super.setupView() addMolecule(stack) - stack.restack() + arrow.pinHeightAndWidth() } - //----------------------------------------------------- - // MARK: - ModelMoleculeViewProtocol - //----------------------------------------------------- - 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? ListThreeColumnInternationalDataDividerModel else { return } + guard let model = model as? ListThreeColumnInternationalDataModel else { return } leftLabel.set(with: model.leftLabel, delegateObject, additionalData) centerLabel.set(with: model.centerLabel, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + arrow.set(with: model.arrow, delegateObject, additionalData) + stack.restack() } - open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { - return 121 + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 } - //----------------------------------------------------- - // MARK: - MVMCoreUIMoleculeViewProtocol - //----------------------------------------------------- - override open func reset() { + open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - centerLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) + leftLabel.styleRegularBodySmall(true) + centerLabel.styleRegularBodySmall(true) + rightLabel.styleRegularBodySmall(true) + arrow.reset() } + } - diff --git a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift similarity index 62% rename from MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift index 19d71073..5a2ceff2 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift @@ -1,36 +1,41 @@ // -// ListThreeColumnInternationalDataDividerModel.swift +// ListThreeColumnInternationalDataModel.swift // MVMCoreUI // -// Created by Kruthika KP on 23/03/20. +// Created by Kruthika KP on 24/03/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // import Foundation -public class ListThreeColumnInternationalDataDividerModel : ListItemModel, MoleculeModelProtocol { - public static var identifier: String = "list3CIntDataDiv" +public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol { + + public static var identifier: String = "list3CIntData" public var leftLabel: LabelModel public var centerLabel: LabelModel public var rightLabel: LabelModel + public var arrow: ArrowModel - public init (leftLabel:LabelModel, centerLabel:LabelModel, rightLabel:LabelModel) { + public init(leftLabel:LabelModel, centerLabel:LabelModel, rightLabel:LabelModel,arrow:ArrowModel){ self.leftLabel = leftLabel self.centerLabel = centerLabel self.rightLabel = rightLabel + self.arrow = arrow super.init() } - override public func setDefaults() { + public override func setDefaults() { super.setDefaults() - style = "tallDivider" + arrow.degrees = 50 + arrow.color = Color.init(uiColor: .mvmGreen) } - private enum CodingKeys: String, CodingKey { + private enum CodingKeys: String, CodingKey{ case moleculeName case leftLabel case centerLabel case rightLabel + case arrow } required public init(from decoder: Decoder) throws { @@ -38,15 +43,17 @@ public class ListThreeColumnInternationalDataDividerModel : ListItemModel, Molec leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel) rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) + arrow = try typeContainer.decode(ArrowModel.self, forKey: .arrow) try super.init(from: decoder) } - public override func encode(to encoder: Encoder) throws { + 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(centerLabel, forKey: .centerLabel) try container.encode(rightLabel, forKey: .rightLabel) + try container.encode(arrow, forKey: .arrow) } } diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 7bda1e5f..666a5c61 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -110,6 +110,7 @@ import Foundation 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) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnInternationalData.self, viewModelClass: ListThreeColumnInternationalDataModel.self) // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) @@ -117,7 +118,6 @@ import Foundation 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) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnInternationalDataDivider.self, viewModelClass: ListThreeColumnInternationalDataDividerModel.self) // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) From 11069d3f7342bf7d64d2c403c8784e6c3ac9b83e Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Wed, 25 Mar 2020 12:59:26 -0400 Subject: [PATCH 04/25] add convenience initializers for creating a legacy footer --- MVMCoreUI.xcodeproj/project.pbxproj | 20 +++++++++++ MVMCoreUI/Atoms/Buttons/ButtonModel.swift | 6 ++-- .../Legacy/Adapters/ActionModelAdapter.swift | 20 +++++++++++ .../Legacy/Adapters/FooterModelAdapter.swift | 36 +++++++++++++++++++ .../Legacy/Adapters/LabelModelAdapter.swift | 33 +++++++++++++++++ 5 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift create mode 100644 MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift create mode 100644 MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 5308ee86..0108ffc0 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -110,6 +110,9 @@ 0AE98BB323FF0934004C5109 /* ExternalLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB223FF0934004C5109 /* ExternalLinkModel.swift */; }; 0AE98BB523FF18D2004C5109 /* Arrow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB423FF18D2004C5109 /* Arrow.swift */; }; 0AE98BB723FF18E9004C5109 /* ArrowModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB623FF18E9004C5109 /* ArrowModel.swift */; }; + 279B1567242BBBF200921D6C /* LabelModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279B1566242BBBF200921D6C /* LabelModelAdapter.swift */; }; + 279B1569242BBC2F00921D6C /* ActionModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */; }; + 279B156D242BBFF100921D6C /* FooterModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279B156C242BBFF100921D6C /* FooterModelAdapter.swift */; }; 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */; }; 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; }; 522679C123FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */; }; @@ -502,6 +505,9 @@ 0AE98BB223FF0934004C5109 /* ExternalLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExternalLinkModel.swift; sourceTree = ""; }; 0AE98BB423FF18D2004C5109 /* Arrow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Arrow.swift; sourceTree = ""; }; 0AE98BB623FF18E9004C5109 /* ArrowModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrowModel.swift; sourceTree = ""; }; + 279B1566242BBBF200921D6C /* LabelModelAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelModelAdapter.swift; sourceTree = ""; }; + 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionModelAdapter.swift; sourceTree = ""; }; + 279B156C242BBFF100921D6C /* FooterModelAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooterModelAdapter.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 = ""; }; 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxAllTextAndLinks.swift; sourceTree = ""; }; @@ -917,6 +923,16 @@ path = Link; sourceTree = ""; }; + 279B1565242BBB8500921D6C /* Adapters */ = { + isa = PBXGroup; + children = ( + 279B1566242BBBF200921D6C /* LabelModelAdapter.swift */, + 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */, + 279B156C242BBFF100921D6C /* FooterModelAdapter.swift */, + ); + path = Adapters; + sourceTree = ""; + }; 5206F150241144A900658DC5 /* Headers */ = { isa = PBXGroup; children = ( @@ -1260,6 +1276,7 @@ D22D1F582204D2590077CEC0 /* Legacy */ = { isa = PBXGroup; children = ( + 279B1565242BBB8500921D6C /* Adapters */, D213347523842FF5008E41B3 /* Views */, D213347423842FE3008E41B3 /* Controllers */, ); @@ -2088,6 +2105,7 @@ C7F8012123E8303200396FBD /* ListRVWheel.swift in Sources */, D29DF29521E7ADB8003B2FB9 /* MFProgrammaticScrollViewController.m in Sources */, D2FB151B23A2B65B00C20E10 /* MoleculeContainer.swift in Sources */, + 279B1569242BBC2F00921D6C /* ActionModelAdapter.swift in Sources */, BB6C6AC0242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */, D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */, D29DF16121E69996003B2FB9 /* MFViewController.m in Sources */, @@ -2113,6 +2131,7 @@ D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */, 0AE14F64238315D2005417F8 /* TextField.swift in Sources */, D29DF17B21E69E1F003B2FB9 /* PrimaryButton.m in Sources */, + 279B1567242BBBF200921D6C /* LabelModelAdapter.swift in Sources */, D2C78CD224228BBD00B69FDE /* ActionOpenPanelModel.swift in Sources */, 017BEB4A236235BA0024EF95 /* ModelMoleculeViewProtocol.swift in Sources */, C695A68123C9830D00BFB94E /* NumberedListModel.swift in Sources */, @@ -2203,6 +2222,7 @@ 01509D932327ECFB00EF99AA /* ProgressBar.swift in Sources */, D260106523D0CEA700764D80 /* StackModel.swift in Sources */, D29770F521F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsViewController.m in Sources */, + 279B156D242BBFF100921D6C /* FooterModelAdapter.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MVMCoreUI/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atoms/Buttons/ButtonModel.swift index ac9d1dc1..f441ef64 100644 --- a/MVMCoreUI/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atoms/Buttons/ButtonModel.swift @@ -42,18 +42,18 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormAction public var updateUI: (() -> Void)? - init(with title: String, action: ActionModelProtocol) { + public init(with title: String, action: ActionModelProtocol) { self.title = title self.action = action } - init(secondaryButtonWith title: String, action: ActionModelProtocol) { + public init(secondaryButtonWith title: String, action: ActionModelProtocol) { self.title = title self.action = action style = .secondary } - init(primaryButtonWith title: String, action: ActionModelProtocol) { + public init(primaryButtonWith title: String, action: ActionModelProtocol) { self.title = title self.action = action style = .primary diff --git a/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift new file mode 100644 index 00000000..ba0ce96b --- /dev/null +++ b/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift @@ -0,0 +1,20 @@ +// +// ActionModelAdapter.swift +// MVMCoreUI +// +// Created by Kyle on 3/25/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +public extension Dictionary { + + func asActionModel() -> ActionModelProtocol? { + guard let castedSelf = self as? [String: Any], + let actionType = ModelRegistry.getType(for: castedSelf.stringForkey(KeyActionType), with: ActionModelProtocol.self), + let actionModel = try? actionType.decode(jsonDict: castedSelf) as? ActionModelProtocol else { + return nil + } + return actionModel + } + +} diff --git a/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift new file mode 100644 index 00000000..7c923ba0 --- /dev/null +++ b/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift @@ -0,0 +1,36 @@ +// +// FooterModelAdapter.swift +// MVMCoreUI +// +// Created by Kyle on 3/25/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +public extension FooterModel { + + convenience init(withPrimaryAction primaryMap: [AnyHashable: Any]? = nil, secondaryAction secondaryMap: [AnyHashable: Any]? = nil, bottomLinkAction linkMap: [AnyHashable: Any]? = nil) { + + var primaryButtonModel: ButtonModel? + var secondaryButtonModel: ButtonModel? + if let primaryActionModel = primaryMap?.asActionModel() { + primaryButtonModel = ButtonModel(primaryButtonWith: primaryActionModel.title ?? "", action: primaryActionModel) + } + if let secondaryActionModel = secondaryMap?.asActionModel() { + secondaryButtonModel = ButtonModel(secondaryButtonWith: secondaryActionModel.title ?? "", action: secondaryActionModel) + } + let twoButtonModel = TwoButtonViewModel(primaryButtonModel, secondaryButtonModel) + + let footerContentModel: MoleculeModelProtocol + if let linkActionJSON = linkMap { + let labelModel = LabelModel(linkAction: linkActionJSON) + let moleculeStack = MoleculeStackModel(molecules: [MoleculeStackItemModel(with: twoButtonModel), MoleculeStackItemModel(with: labelModel)]) + moleculeStack.spacing = MFStyler.defaultVerticalPaddingForApplicationWidth() + footerContentModel = moleculeStack + } else { + footerContentModel = twoButtonModel + } + + self.init(with: footerContentModel) + } + +} diff --git a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift new file mode 100644 index 00000000..757b2ccb --- /dev/null +++ b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift @@ -0,0 +1,33 @@ +// +// LabelModelAdapter.swift +// MVMCoreUI +// +// Created by Kyle on 3/25/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +public extension LabelModel { + + convenience init(linkAction: [AnyHashable: Any]) { + // Concatentate the text. + var titlePrefix = linkAction.stringForkey(KeyTitlePrefix) + var titlePostfix = linkAction.stringForkey(KeyTitlePostfix) + if !titlePrefix.isEmpty { + titlePrefix += " " + } + if !titlePostfix.isEmpty { + titlePostfix += " " + } + let title = linkAction.optionalStringForKey(KeyTitle) ?? "" + let text = "\(titlePrefix)\(title)\(titlePostfix)" + + // Initialize with text. + self.init(text: text) + + // Add action attribute. + if let linkActionModel = linkAction.asActionModel() { + attributes = [LabelAttributeActionModel(titlePrefix.isEmpty ? 0 : titlePrefix.count, title.count, action: linkActionModel)] + } + } + +} From f2f2b179dd6a91e059f411281174bcbafde17496 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Wed, 25 Mar 2020 17:34:47 -0400 Subject: [PATCH 05/25] link only handling --- MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift index 7c923ba0..449227e3 100644 --- a/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift +++ b/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift @@ -23,9 +23,13 @@ public extension FooterModel { let footerContentModel: MoleculeModelProtocol if let linkActionJSON = linkMap { let labelModel = LabelModel(linkAction: linkActionJSON) - let moleculeStack = MoleculeStackModel(molecules: [MoleculeStackItemModel(with: twoButtonModel), MoleculeStackItemModel(with: labelModel)]) - moleculeStack.spacing = MFStyler.defaultVerticalPaddingForApplicationWidth() - footerContentModel = moleculeStack + if primaryButtonModel != nil || secondaryButtonModel != nil { + let moleculeStack = MoleculeStackModel(molecules: [MoleculeStackItemModel(with: twoButtonModel), MoleculeStackItemModel(with: labelModel)]) + moleculeStack.spacing = MFStyler.defaultVerticalPaddingForApplicationWidth() + footerContentModel = moleculeStack + } else { + footerContentModel = labelModel + } } else { footerContentModel = twoButtonModel } From 614a2b89c8c6df204644e31cff10652720d5b199 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Thu, 2 Apr 2020 10:42:23 -0400 Subject: [PATCH 06/25] code review --- MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift | 14 +++++++++----- MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift | 8 ++++---- MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift index ba0ce96b..5e45b6ed 100644 --- a/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift +++ b/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift @@ -8,11 +8,15 @@ public extension Dictionary { - func asActionModel() -> ActionModelProtocol? { - guard let castedSelf = self as? [String: Any], - let actionType = ModelRegistry.getType(for: castedSelf.stringForkey(KeyActionType), with: ActionModelProtocol.self), - let actionModel = try? actionType.decode(jsonDict: castedSelf) as? ActionModelProtocol else { - return nil + func asActionModel() throws -> ActionModelProtocol { + guard let castedSelf = self as? [String: Any] else { + throw ModelRegistry.Error.decoderOther(message: "Dictionary is not of type [String: Any]") + } + guard let actionType = ModelRegistry.getType(for: castedSelf.stringForkey(KeyActionType), with: ActionModelProtocol.self) else { + throw ModelRegistry.Error.decoderErrorModelNotMapped + } + guard let actionModel = try actionType.decode(jsonDict: castedSelf) as? ActionModelProtocol else { + throw ModelRegistry.Error.decoderOther(message: "Could not decode to ActionModelProtocol") } return actionModel } diff --git a/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift index 449227e3..3672a21f 100644 --- a/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift +++ b/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift @@ -12,11 +12,11 @@ public extension FooterModel { var primaryButtonModel: ButtonModel? var secondaryButtonModel: ButtonModel? - if let primaryActionModel = primaryMap?.asActionModel() { - primaryButtonModel = ButtonModel(primaryButtonWith: primaryActionModel.title ?? "", action: primaryActionModel) + if let primaryActionModel = try? primaryMap?.asActionModel(), let title = primaryActionModel.title { + primaryButtonModel = ButtonModel(primaryButtonWith: title, action: primaryActionModel) } - if let secondaryActionModel = secondaryMap?.asActionModel() { - secondaryButtonModel = ButtonModel(secondaryButtonWith: secondaryActionModel.title ?? "", action: secondaryActionModel) + if let secondaryActionModel = try? secondaryMap?.asActionModel(), let title = secondaryActionModel.title { + secondaryButtonModel = ButtonModel(secondaryButtonWith: title, action: secondaryActionModel) } let twoButtonModel = TwoButtonViewModel(primaryButtonModel, secondaryButtonModel) diff --git a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift index 757b2ccb..396de6ea 100644 --- a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift +++ b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift @@ -16,7 +16,7 @@ public extension LabelModel { titlePrefix += " " } if !titlePostfix.isEmpty { - titlePostfix += " " + titlePostfix = " " + titlePostfix } let title = linkAction.optionalStringForKey(KeyTitle) ?? "" let text = "\(titlePrefix)\(title)\(titlePostfix)" @@ -25,7 +25,7 @@ public extension LabelModel { self.init(text: text) // Add action attribute. - if let linkActionModel = linkAction.asActionModel() { + if let linkActionModel = try? linkAction.asActionModel() { attributes = [LabelAttributeActionModel(titlePrefix.isEmpty ? 0 : titlePrefix.count, title.count, action: linkActionModel)] } } From 5098bc911bda89e417c9f3fd0b7e2c7dfec719d9 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Thu, 2 Apr 2020 17:51:19 -0400 Subject: [PATCH 07/25] code review - extra spacing --- MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift index 396de6ea..6b94f63e 100644 --- a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift +++ b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift @@ -10,15 +10,15 @@ public extension LabelModel { convenience init(linkAction: [AnyHashable: Any]) { // Concatentate the text. + let title = linkAction.stringForkey(KeyTitle) var titlePrefix = linkAction.stringForkey(KeyTitlePrefix) var titlePostfix = linkAction.stringForkey(KeyTitlePostfix) - if !titlePrefix.isEmpty { + if !titlePrefix.isEmpty && (!title.isEmpty || !titlePostfix.isEmpty) { titlePrefix += " " } - if !titlePostfix.isEmpty { + if !titlePostfix.isEmpty && !title.isEmpty { titlePostfix = " " + titlePostfix } - let title = linkAction.optionalStringForKey(KeyTitle) ?? "" let text = "\(titlePrefix)\(title)\(titlePostfix)" // Initialize with text. From e88e661e1f738ff311f1694a3c8e56e8bc070803 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 3 Apr 2020 14:38:24 +0530 Subject: [PATCH 08/25] Resolving conflicts --- MVMCoreUI.xcodeproj/project.pbxproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index b751919b..49ac139e 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -177,8 +177,6 @@ 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 */; }; - AA72AF172424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA72AF162424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift */; }; - AA72AF192424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA72AF182424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift */; }; AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; BB2C968F24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */; }; @@ -572,8 +570,6 @@ 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 = ""; }; - AA72AF162424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDivider.swift; sourceTree = ""; }; - AA72AF182424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.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 = ""; }; BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListRightVariableTextLinkAllTextAndLinksModel.swift; sourceTree = ""; }; @@ -1284,8 +1280,6 @@ 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */, 8D3BA9BC2433787000D341BA /* ListThreeColumnInternationalDataDividerModel.swift */, 8D3BA9BE2433789900D341BA /* ListThreeColumnInternationalDataDivider.swift */, - AA72AF162424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift */, - AA72AF182424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift */, ); path = ThreeColumn; sourceTree = ""; @@ -2146,7 +2140,6 @@ 0AE98BB523FF18D2004C5109 /* Arrow.swift in Sources */, D2D90B442404789000DD6EC9 /* MoleculeContainerProtocol.swift in Sources */, 94C0150A24215643005811A9 /* ActionTopAlertModel.swift in Sources */, - AA72AF172424838E00BFA6C2 /* ListThreeColumnSpeedTestDivider.swift in Sources */, 012A88DB238ED45900FE3DA1 /* CarouselModel.swift in Sources */, D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */, 0AE14F64238315D2005417F8 /* TextField.swift in Sources */, @@ -2179,7 +2172,6 @@ D26C5A6B23F4A40D007AEECE /* ListItemModel.swift in Sources */, 0A21DB8D235E06EF00C160A2 /* MFDigitTextField.m in Sources */, 94AF4A4323E9D19E00676048 /* MFCaretView.m in Sources */, - AA72AF192424839F00BFA6C2 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */, 943784F6236B77BB006A1E82 /* GraphViewAnimationHandler.swift in Sources */, 011D95A1240453D0000E3791 /* RuleEqualsModel.swift in Sources */, D29DF2AA21E7B2F9003B2FB9 /* MVMCoreUIConstants.m in Sources */, From dae31e77da5d7b59ad7ed0ff7b291664dfa07c16 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 3 Apr 2020 16:40:40 +0530 Subject: [PATCH 09/25] 19180(List - Three Column - Speed Test - Divider) commit --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../ListThreeColumnSpeedTestDivider.swift | 63 +++++++++++++++++++ ...ListThreeColumnSpeedTestDividerModel.swift | 53 ++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 49ac139e..9ec54660 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -177,6 +177,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 */; }; + AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; }; + AA1EC59924373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59824373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift */; }; AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; BB2C968F24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */; }; @@ -570,6 +572,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 = ""; }; + AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = ""; }; + AA1EC59824373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDivider.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 = ""; }; BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListRightVariableTextLinkAllTextAndLinksModel.swift; sourceTree = ""; }; @@ -1280,6 +1284,8 @@ 5248BFEA23F12E350059236A /* ListThreeColumnPlanDataDivider.swift */, 8D3BA9BC2433787000D341BA /* ListThreeColumnInternationalDataDividerModel.swift */, 8D3BA9BE2433789900D341BA /* ListThreeColumnInternationalDataDivider.swift */, + AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */, + AA1EC59824373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift */, ); path = ThreeColumn; sourceTree = ""; @@ -1985,6 +1991,7 @@ D2E2A99F23E07F8A000B42E6 /* PillButton.swift in Sources */, D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */, D29DF12E21E6851E003B2FB9 /* MVMCoreUITopAlertView.m in Sources */, + AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */, D29DF2CF21E7C104003B2FB9 /* MFLoadingViewController.m in Sources */, D28A837B23C928DA00DFE4FC /* MoleculeListCellProtocol.swift in Sources */, 014AA72F23C5059B006F3E93 /* ThreeLayerPageTemplateModel.swift in Sources */, @@ -2070,6 +2077,7 @@ BB54C5212434D92F0038326C /* ListRightVariableButtonAllTextAndLinksModel.swift in Sources */, D2D6CD4222E78FAB00D701B8 /* ThreeLayerTemplate.swift in Sources */, 01EB368F23609801006832FA /* LabelModel.swift in Sources */, + AA1EC59924373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift in Sources */, 942C378E2412F5B60066E45E /* ModalMoleculeStackTemplate.swift in Sources */, 8D4687E4242E2DF300802879 /* ListFourColumnDataUsageListItem.swift in Sources */, 01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 438f652b..90c3c19d 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -149,6 +149,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerTall.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerTallModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnInternationalDataDivider.self, viewModelClass: ListThreeColumnInternationalDataDividerModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnSpeedTestDivider.self, viewModelClass: ListThreeColumnSpeedTestDividerModel.self) // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift new file mode 100644 index 00000000..fd1ec64f --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift @@ -0,0 +1,63 @@ +// +// ListThreeColumnSpeedTestDivider.swift +// MVMCoreUI +// +// Created by Lekshmi S on 03/04/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ListThreeColumnSpeedTestDivider: TableViewCell { + + //------------------------------------------------------- + // MARK: - Outlets + //------------------------------------------------------- + let leftLabel = Label.createLabelBoldBodySmall(true) + let centerLabel = Label.createLabelBoldBodySmall(true) + let rightLabel = Label.createLabelBoldBodySmall(true) + var stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], axis: .horizontal, spacing: 8) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + addMolecule(stack) + stack.restack() + } + + //------------------------------------------------------ + // 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? ListThreeColumnSpeedTestDividerModel else { return } + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + centerLabel.set(with: model.centerLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 121 + } + + open override func reset() { + super.reset() + leftLabel.styleBoldBodySmall(true) + centerLabel.styleBoldBodySmall(true) + rightLabel.styleBoldBodySmall(true) + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift new file mode 100644 index 00000000..6e590529 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift @@ -0,0 +1,53 @@ +// +// ListThreeColumnSpeedTestDividerModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 03/04/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListThreeColumnSpeedTestDividerModel: ListItemModel, MoleculeModelProtocol { + public static var identifier: String = "list3CSpdTstDiv" + public var leftLabel: LabelModel + public var centerLabel: LabelModel + public var rightLabel: LabelModel + + public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) { + self.leftLabel = leftLabel + self.centerLabel = centerLabel + self.rightLabel = rightLabel + super.init() + } + + /// Defaults to set + override public func setDefaults() { + super.setDefaults() + style = "tallDivider" + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case leftLabel + case centerLabel + case rightLabel + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) + centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel) + rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) + 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(centerLabel, forKey: .centerLabel) + try container.encode(rightLabel, forKey: .rightLabel) + } +} From 1efffcf33dbbb588043a3170669cfabaf405f42b Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 3 Apr 2020 17:40:46 +0530 Subject: [PATCH 10/25] Removed spacing --- .../ThreeColumn/ListThreeColumnSpeedTestDivider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift index fd1ec64f..aa9fbc2d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift @@ -22,7 +22,7 @@ import Foundation // MARK: - Initializers //------------------------------------------------------- public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], axis: .horizontal, spacing: 8) + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], axis: .horizontal) super.init(style: style, reuseIdentifier: reuseIdentifier) } From e0395bea0d2ceaa81abec9a699c384583e2aa109 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 3 Apr 2020 13:34:42 -0400 Subject: [PATCH 11/25] removed requested colors --- MVMCoreUI/Categories/UIColor+Extension.swift | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 81fe6743..76d5041e 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -33,7 +33,6 @@ extension UIColor { "green": (.mvmGreen, "#008330"), "green33": (.mvmGreen33, "#ABE4BF"), "green66": (.mvmGreen66, "#57C880"), - "greenShade1": (.mvmGreenShade1, "#178437"), "greenShade2": (.mvmGreenShade2, "#0F5B25"), "orange": (.mvmOrange, "#ED7000"), "orange66": (.mvmOrange66, "#F3A157"), @@ -47,10 +46,6 @@ extension UIColor { "blueShade1": (.mvmBlueShade1, "#136598"), "blueShade2": (.mvmBlueShade2, "#0B4467"), "yellow": (.mvmYellow, "#FFBC3D"), - "yellow33": (.mvmYellow33, "#FFE9BF"), - "yellow66": (.mvmYellow66, "#FFD37F"), - "yellowShade1": (.mvmYellowShade1, "#CC9630"), - "yellowShade2": (.mvmYellowShade2, "#997126"), "coolGray1": (.mvmCoolGray1, "#F6F6F6"), "coolGray3": (.mvmCoolGray3, "#D8DADA"), "coolGray6": (.mvmCoolGray6, "#747676"), @@ -149,9 +144,6 @@ extension UIColor { /// HEX: #57C880 public static let mvmGreen66 = UIColor.color8Bits(red: 87, green: 200, blue: 128) - /// HEX: #178437 - public static let mvmGreenShade1 = UIColor.color8Bits(red: 23, green: 132, blue: 55) - /// HEX: #0F5B25 public static let mvmGreenShade2 = UIColor.color8Bits(red: 15, green: 91, blue: 37) @@ -181,18 +173,6 @@ extension UIColor { /// HEX: #FFBC3D public static let mvmYellow = UIColor.color8Bits(red: 255, green: 188, blue: 61) - /// HEX: #FFE9BF - public static let mvmYellow33 = UIColor.color8Bits(red: 255, green: 233, blue: 191) - - /// HEX: #FFD37F - public static let mvmYellow66 = UIColor.color8Bits(red: 255, green: 211, blue: 127) - - /// HEX: #CC9630 - public static let mvmYellowShade1 = UIColor.color8Bits(red: 204, green: 150, blue: 48) - - /// HEX: #997126 - public static let mvmYellowShade2 = UIColor.color8Bits(red: 153, green: 113, blue: 38) - //-------------------------------------------------- // MARK: - Gray //-------------------------------------------------- From 3d85f826dcb6765cd3de9ca391a9b94be7922719 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 3 Apr 2020 13:48:59 -0400 Subject: [PATCH 12/25] updated blue hex --- MVMCoreUI/Categories/UIColor+Extension.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 76d5041e..1ef2e217 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -41,7 +41,7 @@ extension UIColor { "orangeShade2": (.mvmOrangeShade2, "#984700"), "orangeAA": (.mvmOrangeAA, "#CC4D0F"), "blue": (.mvmBlue, "#0077B4"), - "blue33": (.mvmBlue33, "#B1D8EF"), + "blue33": (.mvmBlue33, "#ABD8EF"), "blue66": (.mvmBlue66, "#57B1DF"), "blueShade1": (.mvmBlueShade1, "#136598"), "blueShade2": (.mvmBlueShade2, "#0B4467"), @@ -154,8 +154,8 @@ extension UIColor { /// HEX: #0077B4 public static let mvmBlue = UIColor.color8Bits(red: 0, green: 119, blue: 180) - /// HEX: #B1D8EF - public static let mvmBlue33 = UIColor.color8Bits(red: 87, green: 177, blue: 223) + /// HEX: #ABD8EF + public static let mvmBlue33 = UIColor.color8Bits(red: 171, green: 216, blue: 239) /// HEX: #57B1DF public static let mvmBlue66 = UIColor.color8Bits(red: 87, green: 177, blue: 223) From 39b76823237f7a726bd5c04bcbe5270f1cbae76f Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Sat, 4 Apr 2020 00:17:29 +0530 Subject: [PATCH 13/25] BGImageHeadlineBodyButton molecule for 3.0 Addons banner --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../BGImageHeadlineBodyButton.swift | 90 +++++++++++++++++++ .../BGImageHeadlineBodyButtonModel.swift | 75 ++++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift create mode 100644 MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 49ac139e..3b64a728 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -407,6 +407,8 @@ DBC4391B224421A0001AB423 /* CaretLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBC4391A224421A0001AB423 /* CaretLink.swift */; }; DBC4392122491730001AB423 /* LabelWithInternalButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBC4391C2245232D001AB423 /* LabelWithInternalButton.swift */; }; DBEFFA04225A829700230692 /* Label.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB891E822253FA8500022516 /* Label.swift */; }; + EA5124FD243601600051A3A4 /* BGImageHeadlineBodyButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5124FC243601600051A3A4 /* BGImageHeadlineBodyButton.swift */; }; + EA5124FF2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5124FE2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -813,6 +815,8 @@ DBC4391722442197001AB423 /* DashLine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DashLine.swift; sourceTree = ""; }; DBC4391A224421A0001AB423 /* CaretLink.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaretLink.swift; sourceTree = ""; }; DBC4391C2245232D001AB423 /* LabelWithInternalButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelWithInternalButton.swift; sourceTree = ""; }; + EA5124FC243601600051A3A4 /* BGImageHeadlineBodyButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BGImageHeadlineBodyButton.swift; sourceTree = ""; }; + EA5124FE2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BGImageHeadlineBodyButtonModel.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1157,6 +1161,8 @@ C7192E7C23C301750050C2A0 /* HeadLineBodyCaretLinkImage.swift */, D2E2A99923D8D6B4000B42E6 /* HeadlineBodyButtonModel.swift */, 0A7BAD73232A8DC700FB8E22 /* HeadlineBodyButton.swift */, + EA5124FE2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift */, + EA5124FC243601600051A3A4 /* BGImageHeadlineBodyButton.swift */, ); path = VerticalCombinationViews; sourceTree = ""; @@ -2032,6 +2038,7 @@ D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */, 01EB369023609801006832FA /* MoleculeListItemModel.swift in Sources */, D28A838323CCBD3F00DFE4FC /* CircleProgressModel.swift in Sources */, + EA5124FF2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift in Sources */, D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */, DBEFFA04225A829700230692 /* Label.swift in Sources */, D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */, @@ -2224,6 +2231,7 @@ C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */, 01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */, 0A6682A22434DB4F00AD3CA1 /* ListLeftVariableRadioButtonBodyText.swift in Sources */, + EA5124FD243601600051A3A4 /* BGImageHeadlineBodyButton.swift in Sources */, 0105618D224BBE7700E1557D /* FormValidator.swift in Sources */, 01509D912327ECE600EF99AA /* CornerLabels.swift in Sources */, D22D1F1B220341F60077CEC0 /* MVMCoreUICheckBox.m in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 438f652b..53f8fbcf 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -92,6 +92,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: EyebrowHeadlineBodyLink.self, viewModelClass: EyebrowHeadlineBodyLinkModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyLink.self, viewModelClass: HeadlineBodyLinkModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyButton.self, viewModelClass: HeadlineBodyButtonModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: BGImageHeadlineBodyButton.self, viewModelClass: BGImageHeadlineBodyButtonModel.self) // Left Right Molecules MoleculeObjectMapping.shared()?.register(viewClass: CornerLabels.self, viewModelClass: CornerLabelsModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift new file mode 100644 index 00000000..8a62409b --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift @@ -0,0 +1,90 @@ +// +// BGImageHeadlineBodyButton.swift +// MVMCoreUI +// +// Created by Khan, Arshad on 02/04/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers public class BGImageHeadlineBodyButton: Container { + let headlineBody = HeadlineBody(frame: .zero) + let button = PillButton(frame: .zero) + let backgroundImageView = MFLoadImageView(pinnedEdges: .all) + let maxWidth: CGFloat = 350.0 + static let heightConstant: CGFloat = 320.0 + var heightConstraint: NSLayoutConstraint? + + // MARK: - MVMCoreViewProtocol + open override func updateView(_ size: CGFloat) { + super.updateView(size) + headlineBody.updateView(size) + button.updateView(size) + backgroundImageView.updateView(size) + backgroundImageView.alignFillHorizontal() + backgroundImageView.alignFillVertical() + } + + open override func setupView() { + super.setupView() + heightConstraint = heightAnchor.constraint(equalToConstant: Self.heightConstant) + heightConstraint?.isActive = true + + backgroundImageView.addSizeConstraintsForAspectRatio = true + + let container = MVMCoreUICommonViewsUtility.commonView() + addAndContain(container) + + container.addSubview(headlineBody) + container.addSubview(button) + + //Headline view + headlineBody.leadingAnchor.constraint(equalTo: container.leadingAnchor, constant: 0).isActive = true + headlineBody.topAnchor.constraint(equalTo: container.topAnchor, constant: 0).isActive = true + + headlineBody.widthAnchor.constraint(equalTo: container.widthAnchor, multiplier: 0.67).isActive = true + let headLineBodyWidth = headlineBody.widthAnchor.constraint(lessThanOrEqualToConstant: maxWidth) + headLineBodyWidth.priority = UILayoutPriority(250) + headLineBodyWidth.isActive = true + + //Caret view + button.translatesAutoresizingMaskIntoConstraints = false + button.leadingAnchor.constraint(equalTo: container.leadingAnchor, constant: 0).isActive = true + container.bottomAnchor.constraint(greaterThanOrEqualTo: button.bottomAnchor, constant: 0).isActive = true + + button.topAnchor.constraint(equalTo: headlineBody.bottomAnchor, constant: PaddingDefault).isActive = true + + //Background image view + backgroundImageView.translatesAutoresizingMaskIntoConstraints = false + backgroundImageView.imageView.contentMode = .scaleAspectFill + backgroundImageView.alignFillHorizontal() + backgroundImageView.alignFillVertical() + addSubview(backgroundImageView) + NSLayoutConstraint.constraintPinSubview(toSuperview: backgroundImageView) + sendSubviewToBack(backgroundImageView) + } + + // MARK: - MoleculeViewProtocol + open override func reset() { + super.reset() + headlineBody.reset() + backgroundImageView.reset() + } + + // MARK:- MoleculeViewProtocol + public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 320 + } + + public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? BGImageHeadlineBodyButtonModel else { return } + headlineBody.set(with: model.headlineBody, delegateObject, additionalData) + button.setOptional(with: model.button, delegateObject, additionalData) + button.isHidden = model.button == nil + backgroundImageView.set(with: model.image, delegateObject, additionalData) + backgroundImageView.alignFillHorizontal() + backgroundImageView.alignFillVertical() + } +} diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift new file mode 100644 index 00000000..650e4875 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift @@ -0,0 +1,75 @@ +// +// BGImageHeadlineBodyButtonModel.swift +// MVMCoreUI +// +// Created by Khan, Arshad on 02/04/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +import UIKit + +public class BGImageHeadlineBodyButtonModel: ContainerModel, MoleculeModelProtocol { + public static var identifier: String = "bgImageHeadlineBodyButton" + public var backgroundColor: Color? + public var button: ButtonModel? + public var headlineBody: HeadlineBodyModel + public var image: ImageViewModel + + init(headlineBody: HeadlineBodyModel, image: ImageViewModel) { + self.headlineBody = headlineBody + self.image = image + super.init() + setDefaults() + } + + /// Defaults to set + func setDefaults() { + if useHorizontalMargins == nil { + useHorizontalMargins = true + } + if useVerticalMargins == nil { + useVerticalMargins = true + } + if topMarginPadding == nil { + topMarginPadding = PaddingDefault + } + if bottomMarginPadding == nil { + bottomMarginPadding = PaddingDefault + } + if image.height == nil { + image.height = BGImageHeadlineBodyButton.heightConstant + } + button?.size = .tiny + button?.style = .secondary + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case headlineBody + case image + case button + } + + 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) + image = try typeContainer.decode(ImageViewModel.self, forKey: .image) + button = try typeContainer.decodeIfPresent(ButtonModel.self, forKey: .button) + try super.init(from: decoder) + setDefaults() + } + + 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.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(headlineBody, forKey: .headlineBody) + try container.encode(image, forKey: .image) + try container.encodeIfPresent(button, forKey: .button) + } +} + From 74258f642d6ed027b196daa44b76c1b03972c782 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Fri, 3 Apr 2020 15:13:07 -0400 Subject: [PATCH 14/25] move Footer and Label adapters to MF --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ---- .../Legacy/Adapters/FooterModelAdapter.swift | 40 ------------------- .../Legacy/Adapters/LabelModelAdapter.swift | 33 --------------- 3 files changed, 81 deletions(-) delete mode 100644 MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift delete mode 100644 MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 72c1db81..a63b50e6 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -106,9 +106,7 @@ 0AE98BB323FF0934004C5109 /* ExternalLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB223FF0934004C5109 /* ExternalLinkModel.swift */; }; 0AE98BB523FF18D2004C5109 /* Arrow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB423FF18D2004C5109 /* Arrow.swift */; }; 0AE98BB723FF18E9004C5109 /* ArrowModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB623FF18E9004C5109 /* ArrowModel.swift */; }; - 279B1567242BBBF200921D6C /* LabelModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279B1566242BBBF200921D6C /* LabelModelAdapter.swift */; }; 279B1569242BBC2F00921D6C /* ActionModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */; }; - 279B156D242BBFF100921D6C /* FooterModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279B156C242BBFF100921D6C /* FooterModelAdapter.swift */; }; 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */; }; 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; }; 522679C123FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */; }; @@ -503,9 +501,7 @@ 0AE98BB223FF0934004C5109 /* ExternalLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExternalLinkModel.swift; sourceTree = ""; }; 0AE98BB423FF18D2004C5109 /* Arrow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Arrow.swift; sourceTree = ""; }; 0AE98BB623FF18E9004C5109 /* ArrowModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrowModel.swift; sourceTree = ""; }; - 279B1566242BBBF200921D6C /* LabelModelAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelModelAdapter.swift; sourceTree = ""; }; 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionModelAdapter.swift; sourceTree = ""; }; - 279B156C242BBFF100921D6C /* FooterModelAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooterModelAdapter.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 = ""; }; 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxAllTextAndLinks.swift; sourceTree = ""; }; @@ -923,9 +919,7 @@ 279B1565242BBB8500921D6C /* Adapters */ = { isa = PBXGroup; children = ( - 279B1566242BBBF200921D6C /* LabelModelAdapter.swift */, 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */, - 279B156C242BBFF100921D6C /* FooterModelAdapter.swift */, ); path = Adapters; sourceTree = ""; @@ -2162,7 +2156,6 @@ D29DF28C21E7AC2B003B2FB9 /* ViewConstrainingView.m in Sources */, 0AE14F64238315D2005417F8 /* TextField.swift in Sources */, D29DF17B21E69E1F003B2FB9 /* PrimaryButton.m in Sources */, - 279B1567242BBBF200921D6C /* LabelModelAdapter.swift in Sources */, D2C78CD224228BBD00B69FDE /* ActionOpenPanelModel.swift in Sources */, C695A68123C9830D00BFB94E /* NumberedListModel.swift in Sources */, 01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */, @@ -2254,7 +2247,6 @@ 01509D932327ECFB00EF99AA /* ProgressBar.swift in Sources */, D260106523D0CEA700764D80 /* StackModel.swift in Sources */, D29770F521F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsViewController.m in Sources */, - 279B156D242BBFF100921D6C /* FooterModelAdapter.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift deleted file mode 100644 index 3672a21f..00000000 --- a/MVMCoreUI/Legacy/Adapters/FooterModelAdapter.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// FooterModelAdapter.swift -// MVMCoreUI -// -// Created by Kyle on 3/25/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -public extension FooterModel { - - convenience init(withPrimaryAction primaryMap: [AnyHashable: Any]? = nil, secondaryAction secondaryMap: [AnyHashable: Any]? = nil, bottomLinkAction linkMap: [AnyHashable: Any]? = nil) { - - var primaryButtonModel: ButtonModel? - var secondaryButtonModel: ButtonModel? - if let primaryActionModel = try? primaryMap?.asActionModel(), let title = primaryActionModel.title { - primaryButtonModel = ButtonModel(primaryButtonWith: title, action: primaryActionModel) - } - if let secondaryActionModel = try? secondaryMap?.asActionModel(), let title = secondaryActionModel.title { - secondaryButtonModel = ButtonModel(secondaryButtonWith: title, action: secondaryActionModel) - } - let twoButtonModel = TwoButtonViewModel(primaryButtonModel, secondaryButtonModel) - - let footerContentModel: MoleculeModelProtocol - if let linkActionJSON = linkMap { - let labelModel = LabelModel(linkAction: linkActionJSON) - if primaryButtonModel != nil || secondaryButtonModel != nil { - let moleculeStack = MoleculeStackModel(molecules: [MoleculeStackItemModel(with: twoButtonModel), MoleculeStackItemModel(with: labelModel)]) - moleculeStack.spacing = MFStyler.defaultVerticalPaddingForApplicationWidth() - footerContentModel = moleculeStack - } else { - footerContentModel = labelModel - } - } else { - footerContentModel = twoButtonModel - } - - self.init(with: footerContentModel) - } - -} diff --git a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift deleted file mode 100644 index 6b94f63e..00000000 --- a/MVMCoreUI/Legacy/Adapters/LabelModelAdapter.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// LabelModelAdapter.swift -// MVMCoreUI -// -// Created by Kyle on 3/25/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -public extension LabelModel { - - convenience init(linkAction: [AnyHashable: Any]) { - // Concatentate the text. - let title = linkAction.stringForkey(KeyTitle) - var titlePrefix = linkAction.stringForkey(KeyTitlePrefix) - var titlePostfix = linkAction.stringForkey(KeyTitlePostfix) - if !titlePrefix.isEmpty && (!title.isEmpty || !titlePostfix.isEmpty) { - titlePrefix += " " - } - if !titlePostfix.isEmpty && !title.isEmpty { - titlePostfix = " " + titlePostfix - } - let text = "\(titlePrefix)\(title)\(titlePostfix)" - - // Initialize with text. - self.init(text: text) - - // Add action attribute. - if let linkActionModel = try? linkAction.asActionModel() { - attributes = [LabelAttributeActionModel(titlePrefix.isEmpty ? 0 : titlePrefix.count, title.count, action: linkActionModel)] - } - } - -} From bebc0e11bde3fd5174f6abbf6cba559ddb1f0c98 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Sun, 5 Apr 2020 10:51:13 -0400 Subject: [PATCH 15/25] align with anroid changes --- .../LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift index 359beafd..8f2ab081 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift @@ -46,6 +46,7 @@ open class ListLeftVariableRadioButtonBodyTextModel: ListItemModel, MoleculeMode let typeContainer = try decoder.container(keyedBy: CodingKeys.self) radioButton = try typeContainer.decode(RadioButtonModel.self, forKey: .radioButton) headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + headlineBody.headline?.fontStyle = LabelModel.FontStyle.BoldMicro try super.init(from: decoder) } From 3ec2150afe5f5a0b0abe31b6ebaf40c5d5bb2abb Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Mon, 6 Apr 2020 17:15:43 +0530 Subject: [PATCH 16/25] List Three Column International Data - List Item - Added files --- MVMCoreUI.xcodeproj/project.pbxproj | 30 +++++--- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 2 +- .../ListThreeColumnInternationalData.swift | 68 +++++++++++++++++++ ...istThreeColumnInternationalDataModel.swift | 59 ++++++++++++++++ 4 files changed, 150 insertions(+), 9 deletions(-) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 5fa8c961..b5a06ab1 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -135,8 +135,10 @@ 8D448E5524050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */; }; 8D4687E2242E2DE400802879 /* ListFourColumnDataUsageListItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D4687E1242E2DE400802879 /* ListFourColumnDataUsageListItemModel.swift */; }; 8D4687E4242E2DF300802879 /* ListFourColumnDataUsageListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D4687E3242E2DF300802879 /* ListFourColumnDataUsageListItem.swift */; }; - 8DFB6D8B242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFB6D8A242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift */; }; - 8DFB6D8D242A138000A3F715 /* ListThreeColumnInternationalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFB6D8C242A138000A3F715 /* ListThreeColumnInternationalData.swift */; }; + 8DD1E36E243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DD1E36D243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift */; }; + 8DD1E370243B3D0500D8F2DF /* ListThreeColumnInternationalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DD1E36F243B3D0500D8F2DF /* ListThreeColumnInternationalData.swift */; }; + 8DFB6D8B242A137600A3F715 /* (null) in Sources */ = {isa = PBXBuildFile; }; + 8DFB6D8D242A138000A3F715 /* (null) in Sources */ = {isa = PBXBuildFile; }; 942C372E241149170066E45E /* NHaasGroteskDSStd-75Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372C241149170066E45E /* NHaasGroteskDSStd-75Bd.otf */; }; 942C372F241149170066E45E /* NHaasGroteskDSStd-55Rg.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372D241149170066E45E /* NHaasGroteskDSStd-55Rg.otf */; }; 942C378C2412F4FA0066E45E /* ModalMoleculeListTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 942C378B2412F4FA0066E45E /* ModalMoleculeListTemplate.swift */; }; @@ -532,6 +534,8 @@ 8D448E5424050A46006211BB /* ListOneColumnFullWidthTextAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextAllTextAndLinksModel.swift; sourceTree = ""; }; 8D4687E1242E2DE400802879 /* ListFourColumnDataUsageListItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageListItemModel.swift; sourceTree = ""; }; 8D4687E3242E2DF300802879 /* ListFourColumnDataUsageListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageListItem.swift; sourceTree = ""; }; + 8DD1E36D243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalDataModel.swift; sourceTree = ""; }; + 8DD1E36F243B3D0500D8F2DF /* ListThreeColumnInternationalData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnInternationalData.swift; sourceTree = ""; }; 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftRightLabelModel.swift; sourceTree = ""; }; 942C372C241149170066E45E /* NHaasGroteskDSStd-75Bd.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-75Bd.otf"; sourceTree = ""; }; 942C372D241149170066E45E /* NHaasGroteskDSStd-55Rg.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-55Rg.otf"; sourceTree = ""; }; @@ -985,11 +989,18 @@ path = TwoColumn; sourceTree = ""; }; + 8DD1E36C243B3CD900D8F2DF /* ThreeColumn */ = { + isa = PBXGroup; + children = ( + 8DD1E36D243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift */, + 8DD1E36F243B3D0500D8F2DF /* ListThreeColumnInternationalData.swift */, + ); + path = ThreeColumn; + sourceTree = ""; + }; 8DFB6D89242A134600A3F715 /* ThreeColumn */ = { isa = PBXGroup; children = ( - 8DFB6D8A242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift */, - 8DFB6D8C242A138000A3F715 /* ListThreeColumnInternationalData.swift */, ); name = ThreeColumn; path = ../ThreeColumn; @@ -1261,9 +1272,10 @@ D22B38EA23F4E08B00490EF6 /* List */ = { isa = PBXGroup; children = ( - D20492F12434CB5F00A5EED6 /* FourColumn */, - D22D8396241FDE4700D3DF69 /* TwoColumn */, 52267A0523FFE0A900906CBA /* OneColumn */, + D22D8396241FDE4700D3DF69 /* TwoColumn */, + 8DD1E36C243B3CD900D8F2DF /* ThreeColumn */, + D20492F12434CB5F00A5EED6 /* FourColumn */, AA4FC2A323F4F69600E251DB /* RightVariable */, D22B38EB23F4E0AE00490EF6 /* LeftVariable */, ); @@ -1952,7 +1964,7 @@ D28A838123CCB0D800DFE4FC /* AccordionListItemModel.swift in Sources */, DBC4391822442197001AB423 /* CaretView.swift in Sources */, C07065C42395677300FBF997 /* Link.swift in Sources */, - 8DFB6D8D242A138000A3F715 /* ListThreeColumnInternationalData.swift in Sources */, + 8DFB6D8D242A138000A3F715 /* (null) in Sources */, 0A69F611241BDEA700F7231B /* RuleAnyRequiredModel.swift in Sources */, D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */, D29B771022C281F400D6ACE0 /* ModuleMolecule.swift in Sources */, @@ -2093,6 +2105,7 @@ D260105D23D0BCD400764D80 /* Stack.swift in Sources */, 0A7EF85D23D8A95600B2AAD1 /* TextEntryFieldModel.swift in Sources */, BB54C5212434D92F0038326C /* ListRightVariableButtonAllTextAndLinksModel.swift in Sources */, + 8DD1E370243B3D0500D8F2DF /* ListThreeColumnInternationalData.swift in Sources */, D2D6CD4222E78FAB00D701B8 /* ThreeLayerTemplate.swift in Sources */, 01EB368F23609801006832FA /* LabelModel.swift in Sources */, 942C378E2412F5B60066E45E /* ModalMoleculeStackTemplate.swift in Sources */, @@ -2176,6 +2189,7 @@ D27CD4102339057800C1DC07 /* EyebrowHeadlineBodyLink.swift in Sources */, 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalData.swift in Sources */, D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */, + 8DD1E36E243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift in Sources */, D243859923A16B1800332775 /* Container.swift in Sources */, D2C521A923EDE79E00CA2634 /* ViewController.swift in Sources */, D260105B23D0BB7100764D80 /* StackModelProtocol.swift in Sources */, @@ -2233,7 +2247,7 @@ D2B18B922361E65A00A9AEDC /* CoreUIObject.swift in Sources */, D29DF2BE21E7BEA4003B2FB9 /* TopTabbar.m in Sources */, 014AA72E23C5059B006F3E93 /* StackCenteredPageTemplateModel.swift in Sources */, - 8DFB6D8B242A137600A3F715 /* ListThreeColumnInternationalDataModel.swift in Sources */, + 8DFB6D8B242A137600A3F715 /* (null) in Sources */, D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */, 011D959D2404536F000E3791 /* RuleAnyValueChangedModel.swift in Sources */, D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 438f652b..30995284 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -141,7 +141,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageListItem.self, viewModelClass: ListFourColumnDataUsageListItemModel.self) - + MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnInternationalData.self, viewModelClass: ListThreeColumnInternationalDataModel.self) // Designed Section Dividers MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift new file mode 100644 index 00000000..1f0be954 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift @@ -0,0 +1,68 @@ +// +// ListThreeColumnInternationalData.swift +// MVMCoreUI +// +// Created by Kruthika KP on 06/04/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers public class ListThreeColumnInternationalData: TableViewCell { + + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + var stack: Stack + let leftLabel = Label.createLabelRegularBodySmall(true) + let centerLabel = Label.createLabelRegularBodySmall(true) + let rightLabel = Label.createLabelRegularBodySmall(true) + let arrow = Arrow(frame: .zero) + + //----------------------------------------------------- + // MARK: - Initializers + //----------------------------------------------------- + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading)), + (view: arrow, model: StackItemModel(percent: 4, horizontalAlignment: .trailing)), + (view: centerLabel, model: StackItemModel(percent: 46, horizontalAlignment: .leading)), + (view: rightLabel, model: StackItemModel(percent:20,horizontalAlignment: .leading))], + axis: .horizontal,spacing: 2) + 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) + arrow.pinHeightAndWidth() + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListThreeColumnInternationalDataModel else { return } + leftLabel.set(with: model.leftLabel, delegateObject, additionalData) + centerLabel.set(with: model.centerLabel, delegateObject, additionalData) + rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + arrow.set(with: model.arrow, delegateObject, additionalData) + stack.restack() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } + + open override func reset() { + super.reset() + leftLabel.styleRegularBodySmall(true) + centerLabel.styleRegularBodySmall(true) + rightLabel.styleRegularBodySmall(true) + arrow.reset() + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift new file mode 100644 index 00000000..976a6361 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift @@ -0,0 +1,59 @@ +// +// ListThreeColumnInternationalDataModel.swift +// MVMCoreUI +// +// Created by Kruthika KP on 06/04/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol { + + public static var identifier: String = "list3CIntData" + public var leftLabel: LabelModel + public var centerLabel: LabelModel + public var rightLabel: LabelModel + public var arrow: ArrowModel + + public init(leftLabel:LabelModel, centerLabel:LabelModel, rightLabel:LabelModel, arrow:ArrowModel) { + self.leftLabel = leftLabel + self.centerLabel = centerLabel + self.rightLabel = rightLabel + self.arrow = arrow + super.init() + } + + public override func setDefaults() { + super.setDefaults() + arrow.degrees = 50 + arrow.color = Color.init(uiColor: .mvmGreen) + } + + private enum CodingKeys: String, CodingKey { + case moleculeName + case leftLabel + case centerLabel + case rightLabel + case arrow + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) + centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel) + rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) + arrow = try typeContainer.decode(ArrowModel.self, forKey: .arrow) + 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(centerLabel, forKey: .centerLabel) + try container.encode(rightLabel, forKey: .rightLabel) + try container.encode(arrow, forKey: .arrow) + } +} From 51f6dc417c8db0c43ad1fe481e06ae6b6b5aff53 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 6 Apr 2020 09:35:32 -0400 Subject: [PATCH 17/25] revised to common patteren --- .../ListLeftVariableRadioButtonBodyTextModel.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift index 8f2ab081..710a1ef6 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift @@ -26,6 +26,16 @@ open class ListLeftVariableRadioButtonBodyTextModel: ListItemModel, MoleculeMode self.radioButton = radioButton self.headlineBody = headlineBody super.init() + setDefaults() + } + + //----------------------------------------------------- + // MARK: - Methods + //----------------------------------------------------- + + open override func setDefaults() { + super.setDefaults() + headlineBody.style = .item } //----------------------------------------------------- @@ -46,7 +56,6 @@ open class ListLeftVariableRadioButtonBodyTextModel: ListItemModel, MoleculeMode let typeContainer = try decoder.container(keyedBy: CodingKeys.self) radioButton = try typeContainer.decode(RadioButtonModel.self, forKey: .radioButton) headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) - headlineBody.headline?.fontStyle = LabelModel.FontStyle.BoldMicro try super.init(from: decoder) } From 47c5343219ae9f42cc417fc3d87bc468ab61d45b Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 6 Apr 2020 09:38:27 -0400 Subject: [PATCH 18/25] removed --- .../LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift | 1 - .../ThreeColumn/ListThreeColumnPlanDataDividerModel.swift | 1 - 2 files changed, 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift index 710a1ef6..bb8e7ded 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyTextModel.swift @@ -26,7 +26,6 @@ open class ListLeftVariableRadioButtonBodyTextModel: ListItemModel, MoleculeMode self.radioButton = radioButton self.headlineBody = headlineBody super.init() - setDefaults() } //----------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDividerModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDividerModel.swift index 8e718a8a..e727a1c6 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDividerModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnPlanDataDividerModel.swift @@ -19,7 +19,6 @@ public class ListThreeColumnPlanDataDividerModel: ListItemModel, MoleculeModelPr self.centerHeadlineBody = centerHeadlineBody self.rightHeadlineBody = rightHeadlineBody super.init() - setDefaults() } /// Defaults to set From 4d03ef2447bd974b5dbf1b4837c14f537e3d151b Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 6 Apr 2020 11:48:55 -0400 Subject: [PATCH 19/25] mild entryfield changes --- MVMCoreUI/Atomic/Atoms/TextFields/EntryField.swift | 6 +++--- MVMCoreUI/Containers/Views/EntryFieldContainer.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/TextFields/EntryField.swift b/MVMCoreUI/Atomic/Atoms/TextFields/EntryField.swift index a02f87ee..7fb3a458 100644 --- a/MVMCoreUI/Atomic/Atoms/TextFields/EntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/TextFields/EntryField.swift @@ -21,7 +21,7 @@ import UIKit public private(set) var titleLabel: Label = { let label = Label() label.font = MFStyler.fontB3() - label.textColor = .mfBattleshipGrey() + label.textColor = .mvmCoolGray6 label.setContentCompressionResistancePriority(.required, for: .vertical) return label }() @@ -32,7 +32,7 @@ import UIKit public private(set) var feedbackLabel: Label = { let label = Label() label.font = MFStyler.fontForTextFieldUnderLabel() - label.textColor = .black + label.textColor = .mvmBlack label.setContentCompressionResistancePriority(.required, for: .vertical) return label }() @@ -178,7 +178,7 @@ import UIKit isAccessibilityElement = false setContentCompressionResistancePriority(.required, for: .vertical) accessibilityElements = [titleLabel, feedbackLabel] - backgroundColor = .clear + backgroundColor = .mvmWhite addSubview(titleLabel) diff --git a/MVMCoreUI/Containers/Views/EntryFieldContainer.swift b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift index c7e5c3a7..cf56fb9d 100644 --- a/MVMCoreUI/Containers/Views/EntryFieldContainer.swift +++ b/MVMCoreUI/Containers/Views/EntryFieldContainer.swift @@ -256,7 +256,7 @@ import UIKit isUserInteractionEnabled = false hideBorders = false borderStrokeColor = .mfSilver() - bottomBar?.backgroundColor = UIColor.mfSilver().cgColor + bottomBar?.backgroundColor = UIColor.mvmCoolGray3.cgColor refreshUI(bottomBarSize: 1) } From a601041c5fdead31f534b8844393982f462df6f6 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 6 Apr 2020 11:54:14 -0400 Subject: [PATCH 20/25] cleanup --- MVMCoreUI.xcodeproj/project.pbxproj | 9 ------- .../ListThreeColumnInternationalData.swift | 27 +++++++++++-------- ...istThreeColumnInternationalDataModel.swift | 9 +------ 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index b5a06ab1..540d8ec0 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -946,7 +946,6 @@ 52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */, 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */, 8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */, - 8DFB6D89242A134600A3F715 /* ThreeColumn */, ); path = OneColumn; sourceTree = ""; @@ -998,14 +997,6 @@ path = ThreeColumn; sourceTree = ""; }; - 8DFB6D89242A134600A3F715 /* ThreeColumn */ = { - isa = PBXGroup; - children = ( - ); - name = ThreeColumn; - path = ../ThreeColumn; - sourceTree = ""; - }; 94C01508242155FE005811A9 /* Actions */ = { isa = PBXGroup; children = ( diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift index 1f0be954..5fc836d1 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift @@ -13,21 +13,26 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - var stack: Stack - let leftLabel = Label.createLabelRegularBodySmall(true) - let centerLabel = Label.createLabelRegularBodySmall(true) - let rightLabel = Label.createLabelRegularBodySmall(true) - let arrow = Arrow(frame: .zero) - + open var stack: Stack + public let leftLabel = Label.createLabelRegularBodySmall(true) + public let centerLabel = Label.createLabelRegularBodySmall(true) + public let rightLabel = Label.createLabelRegularBodySmall(true) + public let arrow = Arrow(frame: .zero) + public let arrowAndLabel2Stack: Stack + //----------------------------------------------------- // MARK: - Initializers //----------------------------------------------------- public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + arrowAndLabel2Stack = Stack.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)), + (view: centerLabel, model: StackItemModel(horizontalAlignment: .leading))], + axis: .horizontal, spacing: 4) + centerLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) + centerLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: .horizontal) stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading)), - (view: arrow, model: StackItemModel(percent: 4, horizontalAlignment: .trailing)), - (view: centerLabel, model: StackItemModel(percent: 46, horizontalAlignment: .leading)), + (view: arrowAndLabel2Stack, model: StackItemModel(percent: 50, horizontalAlignment: .fill)), (view: rightLabel, model: StackItemModel(percent:20,horizontalAlignment: .leading))], - axis: .horizontal,spacing: 2) + axis: .horizontal) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -42,6 +47,8 @@ import Foundation super.setupView() addMolecule(stack) arrow.pinHeightAndWidth() + arrowAndLabel2Stack.restack() + stack.restack() } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { @@ -51,7 +58,6 @@ import Foundation centerLabel.set(with: model.centerLabel, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) arrow.set(with: model.arrow, delegateObject, additionalData) - stack.restack() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { @@ -63,6 +69,5 @@ import Foundation leftLabel.styleRegularBodySmall(true) centerLabel.styleRegularBodySmall(true) rightLabel.styleRegularBodySmall(true) - arrow.reset() } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift index 976a6361..d0cd3791 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalDataModel.swift @@ -9,7 +9,6 @@ import Foundation public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol { - public static var identifier: String = "list3CIntData" public var leftLabel: LabelModel public var centerLabel: LabelModel @@ -24,12 +23,6 @@ public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModel super.init() } - public override func setDefaults() { - super.setDefaults() - arrow.degrees = 50 - arrow.color = Color.init(uiColor: .mvmGreen) - } - private enum CodingKeys: String, CodingKey { case moleculeName case leftLabel @@ -47,7 +40,7 @@ public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModel try super.init(from: decoder) } - public override func encode(to encoder: Encoder) throws { + 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) From 79dd73ed4433fe4bd74bf500a5d555f82e2eef33 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 6 Apr 2020 11:57:38 -0400 Subject: [PATCH 21/25] toggle --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index 487ad32f..1e072faf 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -25,13 +25,13 @@ public typealias ActionBlockConfirmation = () -> (Bool) //-------------------------------------------------- /// Holds the on and off colors for the container. - public var containerTintColor: (on: UIColor?, off: UIColor?)? = (on: .mfShamrock(), off: .black) + public var containerTintColor: (on: UIColor?, off: UIColor?)? = (on: .mvmGreen, off: .black) /// Holds the on and off colors for the knob. public var knobTintColor: (on: UIColor?, off: UIColor?)? = (on: .white, off: .white) /// Holds the on and off colors for the disabled state.. - public var disabledTintColor: (container: UIColor?, knob: UIColor?)? = (container: .mfSilver(), knob: .white) + public var disabledTintColor: (container: UIColor?, knob: UIColor?)? = (container: .mvmCoolGray3, knob: .white) /// Set this flag to false if you do not want to animate state changes. public var isAnimated = true From d6d1046cd884d73d6597866c4c68829860de9b2e Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 6 Apr 2020 11:57:40 -0400 Subject: [PATCH 22/25] cleanup mistakes --- MVMCoreUI.xcodeproj/project.pbxproj | 4 -- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 3 +- .../ListThreeColumnInternationalData.swift | 70 ------------------- ...istThreeColumnInternationalDataModel.swift | 59 ---------------- 4 files changed, 2 insertions(+), 134 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalData.swift delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 540d8ec0..9fde090d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -137,8 +137,6 @@ 8D4687E4242E2DF300802879 /* ListFourColumnDataUsageListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D4687E3242E2DF300802879 /* ListFourColumnDataUsageListItem.swift */; }; 8DD1E36E243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DD1E36D243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift */; }; 8DD1E370243B3D0500D8F2DF /* ListThreeColumnInternationalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DD1E36F243B3D0500D8F2DF /* ListThreeColumnInternationalData.swift */; }; - 8DFB6D8B242A137600A3F715 /* (null) in Sources */ = {isa = PBXBuildFile; }; - 8DFB6D8D242A138000A3F715 /* (null) in Sources */ = {isa = PBXBuildFile; }; 942C372E241149170066E45E /* NHaasGroteskDSStd-75Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372C241149170066E45E /* NHaasGroteskDSStd-75Bd.otf */; }; 942C372F241149170066E45E /* NHaasGroteskDSStd-55Rg.otf in Resources */ = {isa = PBXBuildFile; fileRef = 942C372D241149170066E45E /* NHaasGroteskDSStd-55Rg.otf */; }; 942C378C2412F4FA0066E45E /* ModalMoleculeListTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 942C378B2412F4FA0066E45E /* ModalMoleculeListTemplate.swift */; }; @@ -1955,7 +1953,6 @@ D28A838123CCB0D800DFE4FC /* AccordionListItemModel.swift in Sources */, DBC4391822442197001AB423 /* CaretView.swift in Sources */, C07065C42395677300FBF997 /* Link.swift in Sources */, - 8DFB6D8D242A138000A3F715 /* (null) in Sources */, 0A69F611241BDEA700F7231B /* RuleAnyRequiredModel.swift in Sources */, D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */, D29B771022C281F400D6ACE0 /* ModuleMolecule.swift in Sources */, @@ -2238,7 +2235,6 @@ D2B18B922361E65A00A9AEDC /* CoreUIObject.swift in Sources */, D29DF2BE21E7BEA4003B2FB9 /* TopTabbar.m in Sources */, 014AA72E23C5059B006F3E93 /* StackCenteredPageTemplateModel.swift in Sources */, - 8DFB6D8B242A137600A3F715 /* (null) in Sources */, D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */, 011D959D2404536F000E3791 /* RuleAnyValueChangedModel.swift in Sources */, D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 30995284..760a7a6c 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -140,8 +140,9 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageListItem.self, viewModelClass: ListFourColumnDataUsageListItemModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnInternationalData.self, viewModelClass: ListThreeColumnInternationalDataModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageListItem.self, viewModelClass: ListFourColumnDataUsageListItemModel.self) + // Designed Section Dividers MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalData.swift deleted file mode 100644 index 948bdb9b..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalData.swift +++ /dev/null @@ -1,70 +0,0 @@ -// -// ListThreeColumnInternationalData.swift -// MVMCoreUI -// -// Created by Kruthika KP on 24/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - - -@objcMembers public class ListThreeColumnInternationalData: TableViewCell { - - //----------------------------------------------------- - // MARK: - Outlets - //----------------------------------------------------- - var stack: Stack - let leftLabel = Label.createLabelRegularBodySmall(true) - let centerLabel = Label.createLabelRegularBodySmall(true) - let rightLabel = Label.createLabelRegularBodySmall(true) - let arrow = Arrow(frame: .zero) - - //----------------------------------------------------- - // MARK: - Initializers - //----------------------------------------------------- - public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading)), - (view: arrow, model: StackItemModel(percent: 4, horizontalAlignment: .trailing)), - (view: centerLabel, model: StackItemModel(percent: 46, horizontalAlignment: .leading)), - (view: rightLabel, model: StackItemModel(percent:30,horizontalAlignment: .center))], - axis: .horizontal,spacing: 2) - 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) - arrow.pinHeightAndWidth() - } - - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ - super.set(with: model, delegateObject, additionalData) - guard let model = model as? ListThreeColumnInternationalDataModel else { return } - leftLabel.set(with: model.leftLabel, delegateObject, additionalData) - centerLabel.set(with: model.centerLabel, delegateObject, additionalData) - rightLabel.set(with: model.rightLabel, delegateObject, additionalData) - arrow.set(with: model.arrow, delegateObject, additionalData) - stack.restack() - } - - open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 90 - } - - open override func reset() { - super.reset() - leftLabel.styleRegularBodySmall(true) - centerLabel.styleRegularBodySmall(true) - rightLabel.styleRegularBodySmall(true) - arrow.reset() - } - -} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataModel.swift deleted file mode 100644 index 5a2ceff2..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataModel.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// ListThreeColumnInternationalDataModel.swift -// MVMCoreUI -// -// Created by Kruthika KP on 24/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol { - - public static var identifier: String = "list3CIntData" - public var leftLabel: LabelModel - public var centerLabel: LabelModel - public var rightLabel: LabelModel - public var arrow: ArrowModel - - public init(leftLabel:LabelModel, centerLabel:LabelModel, rightLabel:LabelModel,arrow:ArrowModel){ - self.leftLabel = leftLabel - self.centerLabel = centerLabel - self.rightLabel = rightLabel - self.arrow = arrow - super.init() - } - - public override func setDefaults() { - super.setDefaults() - arrow.degrees = 50 - arrow.color = Color.init(uiColor: .mvmGreen) - } - - private enum CodingKeys: String, CodingKey{ - case moleculeName - case leftLabel - case centerLabel - case rightLabel - case arrow - } - - required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) - centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel) - rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) - arrow = try typeContainer.decode(ArrowModel.self, forKey: .arrow) - 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(centerLabel, forKey: .centerLabel) - try container.encode(rightLabel, forKey: .rightLabel) - try container.encode(arrow, forKey: .arrow) - } -} From 8e0641c547e5342f6de019b80bed279e3167e08c Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 6 Apr 2020 12:00:08 -0400 Subject: [PATCH 23/25] remove bad commit --- .../OtherHandlers/MoleculeObjectMapping.swift | 144 ------------------ 1 file changed, 144 deletions(-) delete mode 100644 MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift deleted file mode 100644 index 666a5c61..00000000 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ /dev/null @@ -1,144 +0,0 @@ -// -// MVMCoreUIMoleculeMappingObject+ModelMapping.swift -// MVMCoreUI -// -// Created by Suresh, Kamlesh on 10/28/19. -// Copyright © 2019 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers public class MoleculeObjectMapping: NSObject { - public static func registerObjects() { - // Stacks - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackView.self, viewModelClass: MoleculeStackModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Stack.self, viewModelClass: StackModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: UnOrderedList.self, viewModelClass: UnOrderedListModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: NumberedList.self, viewModelClass: NumberedListModel.self) - - // Label - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Label.self, viewModelClass: LabelModel.self) - // need to move labelattributemodel to different method - try? ModelRegistry.register(LabelAttributeFontModel.self) - try? ModelRegistry.register(LabelAttributeColorModel.self) - try? ModelRegistry.register(LabelAttributeImageModel.self) // We need to separate the registry by types due to collisions... - try? ModelRegistry.register(LabelAttributeUnderlineModel.self) - try? ModelRegistry.register(LabelAttributeStrikeThroughModel.self) - try? ModelRegistry.register(LabelAttributeActionModel.self) - - // Buttons - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: PillButton.self, viewModelClass: ButtonModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TwoButtonView.self, viewModelClass: TwoButtonViewModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ExternalLink.self, viewModelClass: ExternalLinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Link.self, viewModelClass: LinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CaretLink.self, viewModelClass: CaretLinkModel.self) - - // Entry Field - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TextEntryField.self, viewModelClass: TextEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MdnEntryField.self, viewModelClass: MdnEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DigitEntryField.self, viewModelClass: DigitEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ItemDropdownEntryField.self, viewModelClass: ItemDropdownEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DateDropdownEntryField.self, viewModelClass: DateDropdownEntryFieldModel.self) - - // Other Atoms - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ProgressBar.self, viewModelClass: ProgressBarModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MultiProgress.self, viewModelClass: MultiProgressBarModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CaretView.self, viewModelClass: CaretViewModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DashLine.self, viewModelClass: DashLineModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MFLoadImageView.self, viewModelClass: ImageViewModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Line.self, viewModelClass: LineModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: GraphView.self, viewModelClass: CircleProgressModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Toggle.self, viewModelClass: ToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Checkbox.self, viewModelClass: CheckboxModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CheckboxLabel.self, viewModelClass: CheckboxLabelModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Arrow.self, viewModelClass: ArrowModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: RadioButton.self, viewModelClass: RadioButtonModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: RadioButtonLabel.self, viewModelClass: RadioButtonLabelModel.self) - - // Horizontal Combination Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: StringAndMoleculeView.self, viewModelClass: StringAndMoleculeModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ImageHeadlineBody.self, viewModelClass: ImageHeadlineBodyModel.self) - - // Vertical Combination Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBody.self, viewModelClass: HeadlineBodyModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadLineBodyCaretLinkImage.self, viewModelClass: HeadlineBodyCaretLinkImageModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: EyebrowHeadlineBodyLink.self, viewModelClass: EyebrowHeadlineBodyLinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyLink.self, viewModelClass: HeadlineBodyLinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyButton.self, viewModelClass: HeadlineBodyButtonModel.self) - - // Left Right Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CornerLabels.self, viewModelClass: CornerLabelsModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: LeftRightLabelView.self, viewModelClass: LeftRightLabelModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: LabelToggle.self, viewModelClass: LabelToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyToggle.self, viewModelClass: HeadlineBodyToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyLinkToggle.self, viewModelClass: HeadlineBodyLinkToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ActionDetailWithImage.self, viewModelClass: ActionDetailWithImageModel.self) - - // List items - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeTableViewCell.self, viewModelClass: MoleculeListItemModel.self) - 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: ListProgressBarData.self, viewModelClass: ListProgressBarDataModel.self) - - // Other Items - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackItem.self, viewModelClass: MoleculeStackItemModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: StackItem.self, viewModelClass: StackItemModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeCollectionViewCell.self, viewModelClass: CarouselItemModel.self) - - // Other Container Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeHeaderView.self, viewModelClass: MoleculeHeaderModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: FooterView.self, viewModelClass: FooterModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Scroller.self, viewModelClass: ScrollerModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ModuleMolecule.self, viewModelClass: ModuleMoleculeModel.self) - - // Other Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DoughnutChartView.self, viewModelClass: DoughnutChartModel.self) - - // Other Organisms - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Carousel.self, viewModelClass: CarouselModel.self) - - // 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: 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: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnInternationalData.self, viewModelClass: ListThreeColumnInternationalDataModel.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: 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) - - // TODO: Need model - MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(MVMCoreUIPageControl.self, forKey: "barsPager" as NSString) - - // TODO: Need View - try? ModelRegistry.register(TabsModel.self) - - // Helper models - try? ModelRegistry.register(RuleRequiredModel.self) - try? ModelRegistry.register(RuleAnyRequiredModel.self) - try? ModelRegistry.register(RuleAnyValueChangedModel.self) - 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) - try? ModelRegistry.register(ActionOpenPanelModel.self) - } -} From 7d740c5cceedb8cf9e992790da6243d4bbbeaa77 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Mon, 6 Apr 2020 22:39:19 +0530 Subject: [PATCH 24/25] changing the priority as per feedback. --- .../BGImageHeadlineBodyButton.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift index 8a62409b..f1ec076c 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButton.swift @@ -43,10 +43,10 @@ import Foundation headlineBody.leadingAnchor.constraint(equalTo: container.leadingAnchor, constant: 0).isActive = true headlineBody.topAnchor.constraint(equalTo: container.topAnchor, constant: 0).isActive = true - headlineBody.widthAnchor.constraint(equalTo: container.widthAnchor, multiplier: 0.67).isActive = true - let headLineBodyWidth = headlineBody.widthAnchor.constraint(lessThanOrEqualToConstant: maxWidth) - headLineBodyWidth.priority = UILayoutPriority(250) + let headLineBodyWidth = headlineBody.widthAnchor.constraint(equalTo: container.widthAnchor, multiplier: 0.67) + headLineBodyWidth.priority = UILayoutPriority(rawValue: 999) headLineBodyWidth.isActive = true + headlineBody.widthAnchor.constraint(lessThanOrEqualToConstant: maxWidth).isActive = true //Caret view button.translatesAutoresizingMaskIntoConstraints = false From dda506f94a0afd9894e138a1541e4b3fb58dcf94 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 7 Apr 2020 12:08:30 +0530 Subject: [PATCH 25/25] Removed duplicate files. --- .../ListThreeColumnSpeedTestDivider.swift | 63 -------- ...ListThreeColumnSpeedTestDividerModel.swift | 53 ------- .../OtherHandlers/MoleculeObjectMapping.swift | 144 ------------------ 3 files changed, 260 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift delete mode 100644 MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift delete mode 100644 MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift deleted file mode 100644 index b278185d..00000000 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// ListThreeColumnSpeedTestDivider.swift -// MVMCoreUI -// -// Created by Lekshmi S on 20/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers open class ListThreeColumnSpeedTestDivider: TableViewCell { - - //------------------------------------------------------- - // MARK: - Outlets - //------------------------------------------------------- - let leftLabel = Label.createLabelBoldBodySmall(true) - let centerLabel = Label.createLabelBoldBodySmall(true) - let rightLabel = Label.createLabelBoldBodySmall(true) - var stack: Stack - - //------------------------------------------------------- - // MARK: - Initializers - //------------------------------------------------------- - public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], axis: .horizontal, spacing: 8) - super.init(style: style, reuseIdentifier: reuseIdentifier) - } - - public required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - //------------------------------------------------------- - // MARK: - View Lifecycle - //------------------------------------------------------- - open override func setupView() { - super.setupView() - addMolecule(stack) - stack.restack() - } - - //------------------------------------------------------ - // 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? ListThreeColumnSpeedTestDividerModel else { return } - leftLabel.set(with: model.leftLabel, delegateObject, additionalData) - centerLabel.set(with: model.centerLabel, delegateObject, additionalData) - rightLabel.set(with: model.rightLabel, delegateObject, additionalData) - } - - open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { - return 121 - } - - open override func reset() { - super.reset() - leftLabel.styleBoldBodySmall(true) - centerLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) - } -} diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift deleted file mode 100644 index 44f697ad..00000000 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDividerModel.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// ListThreeColumnSpeedTestDividerModel.swift -// MVMCoreUI -// -// Created by Lekshmi S on 20/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -public class ListThreeColumnSpeedTestDividerModel: ListItemModel, MoleculeModelProtocol { - public static var identifier: String = "list3CSpdTstDiv" - public var leftLabel: LabelModel - public var centerLabel: LabelModel - public var rightLabel: LabelModel - - public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) { - self.leftLabel = leftLabel - self.centerLabel = centerLabel - self.rightLabel = rightLabel - super.init() - } - - /// Defaults to set - override public func setDefaults() { - super.setDefaults() - style = "tallDivider" - } - - private enum CodingKeys: String, CodingKey { - case moleculeName - case leftLabel - case centerLabel - case rightLabel - } - - required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) - centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel) - rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) - 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(centerLabel, forKey: .centerLabel) - try container.encode(rightLabel, forKey: .rightLabel) - } -} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift deleted file mode 100644 index a364e216..00000000 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ /dev/null @@ -1,144 +0,0 @@ -// -// MVMCoreUIMoleculeMappingObject+ModelMapping.swift -// MVMCoreUI -// -// Created by Suresh, Kamlesh on 10/28/19. -// Copyright © 2019 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers public class MoleculeObjectMapping: NSObject { - public static func registerObjects() { - // Stacks - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackView.self, viewModelClass: MoleculeStackModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Stack.self, viewModelClass: StackModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: UnOrderedList.self, viewModelClass: UnOrderedListModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: NumberedList.self, viewModelClass: NumberedListModel.self) - - // Label - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Label.self, viewModelClass: LabelModel.self) - // need to move labelattributemodel to different method - try? ModelRegistry.register(LabelAttributeFontModel.self) - try? ModelRegistry.register(LabelAttributeColorModel.self) - try? ModelRegistry.register(LabelAttributeImageModel.self) // We need to separate the registry by types due to collisions... - try? ModelRegistry.register(LabelAttributeUnderlineModel.self) - try? ModelRegistry.register(LabelAttributeStrikeThroughModel.self) - try? ModelRegistry.register(LabelAttributeActionModel.self) - - // Buttons - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: PillButton.self, viewModelClass: ButtonModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TwoButtonView.self, viewModelClass: TwoButtonViewModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ExternalLink.self, viewModelClass: ExternalLinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Link.self, viewModelClass: LinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CaretLink.self, viewModelClass: CaretLinkModel.self) - - // Entry Field - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: TextEntryField.self, viewModelClass: TextEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MdnEntryField.self, viewModelClass: MdnEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DigitEntryField.self, viewModelClass: DigitEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ItemDropdownEntryField.self, viewModelClass: ItemDropdownEntryFieldModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DateDropdownEntryField.self, viewModelClass: DateDropdownEntryFieldModel.self) - - // Other Atoms - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ProgressBar.self, viewModelClass: ProgressBarModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MultiProgress.self, viewModelClass: MultiProgressBarModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CaretView.self, viewModelClass: CaretViewModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DashLine.self, viewModelClass: DashLineModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MFLoadImageView.self, viewModelClass: ImageViewModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Line.self, viewModelClass: LineModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: GraphView.self, viewModelClass: CircleProgressModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Toggle.self, viewModelClass: ToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Checkbox.self, viewModelClass: CheckboxModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CheckboxLabel.self, viewModelClass: CheckboxLabelModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Arrow.self, viewModelClass: ArrowModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: RadioButton.self, viewModelClass: RadioButtonModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: RadioButtonLabel.self, viewModelClass: RadioButtonLabelModel.self) - - // Horizontal Combination Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: StringAndMoleculeView.self, viewModelClass: StringAndMoleculeModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ImageHeadlineBody.self, viewModelClass: ImageHeadlineBodyModel.self) - - // Vertical Combination Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBody.self, viewModelClass: HeadlineBodyModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadLineBodyCaretLinkImage.self, viewModelClass: HeadlineBodyCaretLinkImageModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: EyebrowHeadlineBodyLink.self, viewModelClass: EyebrowHeadlineBodyLinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyLink.self, viewModelClass: HeadlineBodyLinkModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyButton.self, viewModelClass: HeadlineBodyButtonModel.self) - - // Left Right Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: CornerLabels.self, viewModelClass: CornerLabelsModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: LeftRightLabelView.self, viewModelClass: LeftRightLabelModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: LabelToggle.self, viewModelClass: LabelToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyToggle.self, viewModelClass: HeadlineBodyToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadlineBodyLinkToggle.self, viewModelClass: HeadlineBodyLinkToggleModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ActionDetailWithImage.self, viewModelClass: ActionDetailWithImageModel.self) - - // List items - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeTableViewCell.self, viewModelClass: MoleculeListItemModel.self) - 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: ListProgressBarData.self, viewModelClass: ListProgressBarDataModel.self) - - // Other Items - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeStackItem.self, viewModelClass: MoleculeStackItemModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: StackItem.self, viewModelClass: StackItemModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeCollectionViewCell.self, viewModelClass: CarouselItemModel.self) - - // Other Container Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: MoleculeHeaderView.self, viewModelClass: MoleculeHeaderModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: FooterView.self, viewModelClass: FooterModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Scroller.self, viewModelClass: ScrollerModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ModuleMolecule.self, viewModelClass: ModuleMoleculeModel.self) - - // Other Molecules - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: DoughnutChartView.self, viewModelClass: DoughnutChartModel.self) - - // Other Organisms - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: Carousel.self, viewModelClass: CarouselModel.self) - - // 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: 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: 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: ListOneColumnTextWithWhitespaceDividerShort.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerShortModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerTall.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerTallModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnSpeedTestDivider.self, viewModelClass: ListThreeColumnSpeedTestDividerModel.self) - - // Designed Headers - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) - - // TODO: Need model - MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(MVMCoreUIPageControl.self, forKey: "barsPager" as NSString) - - // TODO: Need View - try? ModelRegistry.register(TabsModel.self) - - // Helper models - try? ModelRegistry.register(RuleRequiredModel.self) - try? ModelRegistry.register(RuleAnyRequiredModel.self) - try? ModelRegistry.register(RuleAnyValueChangedModel.self) - 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) - try? ModelRegistry.register(ActionOpenPanelModel.self) - } -}