From 78fbadb1e1c94d41ef7bf30057626d5f52a5f84d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 4 Mar 2020 16:46:21 +0530 Subject: [PATCH 01/22] 19198 - Headers - H1 - Button initial commit --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ .../DesignedComponents/HeadersH1Button.swift | 51 +++++++++++++++++ .../HeadersH1ButtonModel.swift | 56 +++++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 2 + 4 files changed, 117 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 339735f3..6ac7694e 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -147,6 +147,8 @@ 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; + AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */; }; + AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; @@ -492,6 +494,8 @@ 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; + AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; + AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; 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 = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; @@ -1041,6 +1045,8 @@ children = ( D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, + AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, + AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, ); path = DesignedComponents; sourceTree = ""; @@ -1819,6 +1825,7 @@ 0A7EF86723D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift in Sources */, 94FB966323D797DA003D482B /* MFTextButton.m in Sources */, D260105323CEA61600764D80 /* ToggleModel.swift in Sources */, + AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */, 014AA72523C501E2006F3E93 /* ContainerModel.swift in Sources */, 0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */, D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, @@ -1912,6 +1919,7 @@ 0AE98BB723FF18E9004C5109 /* ArrowModel.swift in Sources */, D28A837D23CCA86A00DFE4FC /* TabsListItemModel.swift in Sources */, 012A88C6238DA34000FE3DA1 /* ModuleMoleculeModel.swift in Sources */, + AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */, 94C2D9A123872BCC0006CF46 /* LabelAttributeUnderlineModel.swift in Sources */, D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */, D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift new file mode 100644 index 00000000..6e720fd4 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift @@ -0,0 +1,51 @@ +// +// HeadersH1Button.swift +// MVMCoreUI +// +// Created by Lekshmi S on 04/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH1Button: View { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + let headlineBody = HeadlineBody(frame: .zero) + let button = PrimaryButton.button() + let stack = UIStackView() + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + stack.translatesAutoresizingMaskIntoConstraints = false + stack.addArrangedSubview(headlineBody) + stack.setCustomSpacing(72.0, after: headlineBody) + stack.addArrangedSubview(button) + stack.axis = .vertical + stack.alignment = .leading + } + + //---------------------------------------------------- + // 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? HeadersH1ButtonModel else { return } + headlineBody.set(with: model.headlineBody, delegateObject, additionalData) + button.set(with: model.button, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headlineBody.reset() + button.reset() + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift new file mode 100644 index 00000000..48e639a4 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift @@ -0,0 +1,56 @@ +// +// HeadersH1ButtonModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 04/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH1ButtonModel: MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "headerH1Btn" + public var backgroundColor: Color? + public var headlineBody: HeadlineBodyModel + public var button: ButtonModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headlineBody: HeadlineBodyModel, button: ButtonModel) { + self.headlineBody = headlineBody + self.button = button + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case headlineBody + case button + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) + headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + button = try typeContainer.decode(ButtonModel.self, forKey: .button) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(headlineBody, forKey: .headlineBody) + try container.encode(button, forKey: .button) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 34da2080..cb11e2f4 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -103,6 +103,8 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListLeftVariableRadioButtonAndPaymentMethod.self, viewModelClass: ListLeftVariableRadioButtonAndPaymentMethodModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) + + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) From f2b5c53f3a3d7d06dfbef23cfbc9fa8ff3f88dbd Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 5 Mar 2020 10:25:22 +0530 Subject: [PATCH 02/22] Code refactor. --- .../DesignedComponents/HeadersH1Button.swift | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift index 6e720fd4..7e600f7b 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift @@ -14,19 +14,23 @@ import Foundation //-------------------------------------------------- let headlineBody = HeadlineBody(frame: .zero) let button = PrimaryButton.button() - let stack = UIStackView() + var stack = Stack(frame: .zero) + var spacingBetwenHeadlineBodyAndButton: CGFloat = 72.0 //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- open override func setupView() { super.setupView() - stack.translatesAutoresizingMaskIntoConstraints = false - stack.addArrangedSubview(headlineBody) - stack.setCustomSpacing(72.0, after: headlineBody) - stack.addArrangedSubview(button) - stack.axis = .vertical - stack.alignment = .leading + stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), + (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical) + addSubview(stack) + NSLayoutConstraint.constraintPinSubview(toSuperview: stack) + } + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + stack.updateView(size) } //---------------------------------------------------- @@ -37,6 +41,7 @@ import Foundation guard let model = model as? HeadersH1ButtonModel else { return } headlineBody.set(with: model.headlineBody, delegateObject, additionalData) button.set(with: model.button, delegateObject, additionalData) + stack.restack() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { From 105c5b5f785848f34842d1703c9fdc51ba0bd24a Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 5 Mar 2020 12:31:26 +0530 Subject: [PATCH 03/22] Code refactor changes --- MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift index 7e600f7b..0600cf1e 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift @@ -50,7 +50,7 @@ import Foundation open override func reset() { super.reset() - headlineBody.reset() + headlineBody.styleLandingPageHeader() button.reset() } } From 12d8520e424ce05a68360684fcfea755d5870914 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Mon, 9 Mar 2020 13:24:48 +0530 Subject: [PATCH 04/22] 19210(Headers - H1 - Bill) initial commit. Created molecule and model class --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ .../DesignedComponents/HeadersH1Bill.swift | 76 +++++++++++++++++++ .../HeadersH1BillModel.swift | 76 +++++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 161 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 8de69762..ad7231bb 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -154,6 +154,8 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; + AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */; }; + AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -505,6 +507,8 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; + AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; + AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -1054,6 +1058,8 @@ 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, + AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, + AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, ); path = DesignedComponents; sourceTree = ""; @@ -1788,6 +1794,7 @@ D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */, 014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */, + AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */, D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */, 0AE98BAF23FEF956004C5109 /* ExternalLink.swift in Sources */, 012A88C4238D86E600FE3DA1 /* CarouselItemModelProtocol.swift in Sources */, @@ -1847,6 +1854,7 @@ D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */, D2B18B94236214AD00A9AEDC /* NavigationController.swift in Sources */, D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */, + AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */, D282AACB2243C61700C46919 /* ButtonView.swift in Sources */, D260105D23D0BCD400764D80 /* Stack.swift in Sources */, 0A7EF85D23D8A95600B2AAD1 /* TextEntryFieldModel.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift new file mode 100644 index 00000000..68c696e0 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift @@ -0,0 +1,76 @@ +// +// HeadersH1Bill.swift +// MVMCoreUI +// +// Created by Lekshmi S on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH1Bill: View { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + let headline = Label.commonLabelH1(true) + let headline2 = Label.commonLabelH1(true) + let subHeadline = Label.commonLabelB3(true) + let body = Label.commonLabelB2(true) + let link = Link() + let buttons = TwoButtonView(frame: .zero) + var stack = Stack(frame: .zero) + + //-------------------------------------------------- + // MARK: - Constants + //-------------------------------------------------- + let spacingBetweenHeadlineHeadline2: CGFloat = 9.0 + let spacingBetweenHeadlin2esubHeadline: CGFloat = 24.0 + let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 + let spacingBetweenLinkButtons: CGFloat = 129.0 + + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), + (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadlin2esubHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons, horizontalAlignment: .leading))], axis: .vertical) + addSubview(stack) + NSLayoutConstraint.constraintPinSubview(toSuperview: stack) + } + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + stack.updateView(size) + } + + //---------------------------------------------------- + // 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? HeadersH1BillModel else { return } + headline.set(with: model.headline, delegateObject, additionalData) + headline2.set(with: model.headline2, delegateObject, additionalData) + subHeadline.set(with: model.subHeadline, delegateObject, additionalData) + body.set(with: model.body, delegateObject, additionalData) + link.set(with: model.link, delegateObject, additionalData) + buttons.set(with: model.buttons, delegateObject, additionalData) + stack.restack() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headline.styleH1(true) + headline2.styleH1(true) + subHeadline.styleB3(true) + body.styleB2(true) + link.reset() + buttons.reset() + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift new file mode 100644 index 00000000..168f63ae --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift @@ -0,0 +1,76 @@ +// +// HeadersH1BillModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH1BillModel: MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "headerH1Bill" + public var backgroundColor: Color? + public var headline: LabelModel + public var headline2: LabelModel + public var subHeadline: LabelModel + public var body: LabelModel + public var link: LinkModel + public var buttons: TwoButtonViewModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headline: LabelModel, headline2: LabelModel, subHeadline: LabelModel, body: LabelModel, link: LinkModel, buttons: TwoButtonViewModel) { + self.headline = headline + self.headline2 = headline2 + self.subHeadline = subHeadline + self.body = body + self.link = link + self.buttons = buttons + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case headline + case headline2 + case subHeadline + case body + case link + case buttons + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + headline2 = try typeContainer.decode(LabelModel.self, forKey: .headline2) + subHeadline = try typeContainer.decode(LabelModel.self, forKey: .subHeadline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + link = try typeContainer.decode(LinkModel.self, forKey: .link) + buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(headline, forKey: .headline) + try container.encode(headline2, forKey: .headline2) + try container.encode(subHeadline, forKey: .subHeadline) + try container.encode(body, forKey: .body) + try container.encode(link, forKey: .link) + try container.encode(buttons, forKey: .buttons) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 003b5d03..2b8eaa88 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -109,6 +109,7 @@ import Foundation // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Bill.self, viewModelClass: HeadersH1BillModel.self) // TODO: Need model MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString) From f58b57e145900ee68dec07dae007f9356cd96f27 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 18 Mar 2020 10:04:37 +0530 Subject: [PATCH 05/22] Folder structure changes and conforming to headerView and headermodel --- MVMCoreUI.xcodeproj/project.pbxproj | 12 ++++++------ .../{ => Headers}/HeadersH1Button.swift | 16 +++++----------- .../{ => Headers}/HeadersH1ButtonModel.swift | 14 ++++++-------- .../OtherHandlers/MoleculeObjectMapping.swift | 3 +-- 4 files changed, 18 insertions(+), 27 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1Button.swift (79%) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1ButtonModel.swift (82%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 44bed63f..5b69472d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -175,10 +175,10 @@ AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; - BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; - BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -554,10 +554,10 @@ AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; - BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; - BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -898,6 +898,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, + AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, ); path = Headers; sourceTree = ""; @@ -1159,8 +1161,6 @@ 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, - AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, - AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, ); path = DesignedComponents; sourceTree = ""; diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Button.swift similarity index 79% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Button.swift index 0600cf1e..0abf9673 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Button.swift @@ -8,14 +8,13 @@ import Foundation -@objcMembers open class HeadersH1Button: View { +@objcMembers open class HeadersH1Button: HeaderView { //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- let headlineBody = HeadlineBody(frame: .zero) let button = PrimaryButton.button() var stack = Stack(frame: .zero) - var spacingBetwenHeadlineBodyAndButton: CGFloat = 72.0 //------------------------------------------------------- // MARK: - View Lifecycle @@ -23,14 +22,10 @@ import Foundation open override func setupView() { super.setupView() stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), - (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical) - addSubview(stack) - NSLayoutConstraint.constraintPinSubview(toSuperview: stack) - } - - open override func updateView(_ size: CGFloat) { - super.updateView(size) - stack.updateView(size) + (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) + headlineBody.styleLandingPageHeader() + addMolecule(stack) + stack.restack() } //---------------------------------------------------- @@ -41,7 +36,6 @@ import Foundation guard let model = model as? HeadersH1ButtonModel else { return } headlineBody.set(with: model.headlineBody, delegateObject, additionalData) button.set(with: model.button, delegateObject, additionalData) - stack.restack() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift similarity index 82% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift index 48e639a4..d008bab2 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift @@ -8,22 +8,21 @@ import Foundation -public class HeadersH1ButtonModel: MoleculeModelProtocol { +public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public static var identifier: String = "headerH1Btn" - public var backgroundColor: Color? public var headlineBody: HeadlineBodyModel public var button: ButtonModel - + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- public init(headlineBody: HeadlineBodyModel, button: ButtonModel) { self.headlineBody = headlineBody self.button = button + super.init() } //-------------------------------------------------- @@ -31,7 +30,6 @@ public class HeadersH1ButtonModel: MoleculeModelProtocol { //-------------------------------------------------- private enum CodingKeys: String, CodingKey { case moleculeName - case backgroundColor case headlineBody case button } @@ -41,15 +39,15 @@ public class HeadersH1ButtonModel: MoleculeModelProtocol { //-------------------------------------------------- required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) button = try typeContainer.decode(ButtonModel.self, forKey: .button) + try super.init(from: decoder) } - public 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.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(headlineBody, forKey: .headlineBody) try container.encode(button, forKey: .button) } diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 2c89d4b5..26abaccc 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -111,8 +111,6 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) - // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) @@ -120,6 +118,7 @@ import Foundation // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // TODO: Need model MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(MVMCoreUIPageControl.self, forKey: "barsPager" as NSString) From 5eb396092674ddf3a4f43a46c757770473ab3324 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 18 Mar 2020 16:49:45 +0530 Subject: [PATCH 06/22] Folder structure changes and conforming to headerView and headermodel. --- MVMCoreUI.xcodeproj/project.pbxproj | 20 +++++++++---------- .../{ => Headers}/HeadersH1Bill.swift | 13 +++--------- .../{ => Headers}/HeadersH1BillModel.swift | 12 +++++------ 3 files changed, 18 insertions(+), 27 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1Bill.swift (92%) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1BillModel.swift (88%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 9c3293cd..4b5e5103 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -173,12 +173,12 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; - BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; - BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; - AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; - AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */; }; AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */; }; + AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; + AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -552,12 +552,12 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; - BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; - BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; - AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; - AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; + AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; + AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -898,6 +898,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, + AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, ); path = Headers; sourceTree = ""; @@ -1159,8 +1161,6 @@ 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, - AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, - AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, ); path = DesignedComponents; sourceTree = ""; diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift similarity index 92% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift index 68c696e0..73879617 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift @@ -8,7 +8,7 @@ import Foundation -@objcMembers open class HeadersH1Bill: View { +@objcMembers open class HeadersH1Bill: HeaderView { //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- @@ -28,7 +28,6 @@ import Foundation let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 let spacingBetweenLinkButtons: CGFloat = 129.0 - //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- @@ -36,13 +35,8 @@ import Foundation super.setupView() stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadlin2esubHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons, horizontalAlignment: .leading))], axis: .vertical) - addSubview(stack) - NSLayoutConstraint.constraintPinSubview(toSuperview: stack) - } - - open override func updateView(_ size: CGFloat) { - super.updateView(size) - stack.updateView(size) + addMolecule(stack) + stack.restack() } //---------------------------------------------------- @@ -57,7 +51,6 @@ import Foundation body.set(with: model.body, delegateObject, additionalData) link.set(with: model.link, delegateObject, additionalData) buttons.set(with: model.buttons, delegateObject, additionalData) - stack.restack() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift similarity index 88% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift index 168f63ae..d901b38c 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift @@ -8,13 +8,11 @@ import Foundation -public class HeadersH1BillModel: MoleculeModelProtocol { +public class HeadersH1BillModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public static var identifier: String = "headerH1Bill" - public var backgroundColor: Color? public var headline: LabelModel public var headline2: LabelModel public var subHeadline: LabelModel @@ -32,6 +30,7 @@ public class HeadersH1BillModel: MoleculeModelProtocol { self.body = body self.link = link self.buttons = buttons + super.init() } //-------------------------------------------------- @@ -39,7 +38,6 @@ public class HeadersH1BillModel: MoleculeModelProtocol { //-------------------------------------------------- private enum CodingKeys: String, CodingKey { case moleculeName - case backgroundColor case headline case headline2 case subHeadline @@ -53,19 +51,19 @@ public class HeadersH1BillModel: MoleculeModelProtocol { //-------------------------------------------------- required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) headline = try typeContainer.decode(LabelModel.self, forKey: .headline) headline2 = try typeContainer.decode(LabelModel.self, forKey: .headline2) subHeadline = try typeContainer.decode(LabelModel.self, forKey: .subHeadline) body = try typeContainer.decode(LabelModel.self, forKey: .body) link = try typeContainer.decode(LinkModel.self, forKey: .link) buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons) + try super.init(from: decoder) } - public 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.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(headline, forKey: .headline) try container.encode(headline2, forKey: .headline2) try container.encode(subHeadline, forKey: .subHeadline) From 55c841d99229d52b19bb6ff280b12266f0396d32 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 15 Apr 2020 17:50:54 +0530 Subject: [PATCH 07/22] Restructured folder after merge from develop. --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++++++++-------- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Headers/HeadersH1Button.swift | 5 ++--- .../Headers/HeadersH1ButtonModel.swift | 0 4 files changed, 11 insertions(+), 11 deletions(-) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1Button.swift (90%) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1ButtonModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f33cb87a..ffba12b8 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -184,8 +184,8 @@ 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; - AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */; }; - AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */; }; + AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC624472DB0004D2810 /* HeadersH1Button.swift */; }; + AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */; }; 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 */; }; @@ -612,8 +612,8 @@ 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; - AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; - AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; + AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; 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 = ""; }; @@ -998,8 +998,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, - AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, + AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, ); path = Headers; sourceTree = ""; @@ -2200,7 +2200,6 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */, D29C94D5242901C9003813BA /* MVMCoreUICommonViewsUtility+Extension.swift in Sources */, D260105323CEA61600764D80 /* ToggleModel.swift in Sources */, - AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */, 014AA72523C501E2006F3E93 /* ContainerModel.swift in Sources */, 0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */, D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, @@ -2275,6 +2274,7 @@ AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */, 522679C223FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift in Sources */, 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */, + AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */, @@ -2319,7 +2319,6 @@ 0AE98BB723FF18E9004C5109 /* ArrowModel.swift in Sources */, D28A837D23CCA86A00DFE4FC /* TabsListItemModel.swift in Sources */, 012A88C6238DA34000FE3DA1 /* ModuleMoleculeModel.swift in Sources */, - AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */, 94C2D9A123872BCC0006CF46 /* LabelAttributeUnderlineModel.swift in Sources */, D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */, D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */, @@ -2337,6 +2336,7 @@ BB54C5202434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift in Sources */, 948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */, 013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */, + AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */, 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */, D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */, D2E2A9A323E096B1000B42E6 /* DisableableModelProtocol.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index ab0d5b43..ffa26033 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -163,6 +163,7 @@ import Foundation // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // TODO: Need View try? ModelRegistry.register(TabsModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Button.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift similarity index 90% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Button.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift index 0abf9673..a7534e1a 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Button.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift @@ -13,7 +13,7 @@ import Foundation // MARK: - Outlets //-------------------------------------------------- let headlineBody = HeadlineBody(frame: .zero) - let button = PrimaryButton.button() + let button = PillButton(frame: .zero) var stack = Stack(frame: .zero) //------------------------------------------------------- @@ -21,8 +21,7 @@ import Foundation //------------------------------------------------------- open override func setupView() { super.setupView() - stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), - (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) + stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) headlineBody.styleLandingPageHeader() addMolecule(stack) stack.restack() diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1ButtonModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift From 9760953004358838c3c9a76fb51bf2b522a4829d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 15 Apr 2020 18:00:14 +0530 Subject: [PATCH 08/22] Restructured folder after merge from develop. --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++++++++-------- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Headers/HeadersH1Bill.swift | 0 .../Headers/HeadersH1BillModel.swift | 0 4 files changed, 9 insertions(+), 8 deletions(-) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1Bill.swift (100%) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1BillModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index bd526826..1c9ce337 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -184,14 +184,14 @@ 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; + AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */; }; + AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */; }; 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 */; }; AA56A20F243C5EE900303286 /* ListTwoColumnSubsectionDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA56A20E243C5EE900303286 /* ListTwoColumnSubsectionDividerModel.swift */; }; AA56A211243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */; }; - AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */; }; - AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.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 */; }; @@ -612,14 +612,14 @@ 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; + AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; + AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; 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 = ""; }; AA56A20E243C5EE900303286 /* ListTwoColumnSubsectionDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnSubsectionDividerModel.swift; sourceTree = ""; }; AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnSubsectionDivider.swift; sourceTree = ""; }; - AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; - AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.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 = ""; }; @@ -998,8 +998,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, - AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, + AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */, + AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */, ); path = Headers; sourceTree = ""; @@ -2133,7 +2133,6 @@ D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */, 014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */, - AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */, D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */, 0AE98BAF23FEF956004C5109 /* ExternalLink.swift in Sources */, 012A88C4238D86E600FE3DA1 /* CarouselItemModelProtocol.swift in Sources */, @@ -2181,6 +2180,7 @@ D2A92886241ACD99004E01C6 /* ProgrammaticTableViewController.swift in Sources */, BBAA4F05243D8E3B005AAD5F /* RadioBoxesModel.swift in Sources */, 01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */, + AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */, 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */, D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */, 5248BFEC23F12E350059236A /* ListThreeColumnPlanDataDivider.swift in Sources */, @@ -2207,7 +2207,6 @@ D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */, D2B18B94236214AD00A9AEDC /* NavigationController.swift in Sources */, D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */, - AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */, D282AACB2243C61700C46919 /* ButtonView.swift in Sources */, D260105D23D0BCD400764D80 /* Stack.swift in Sources */, 0A7EF85D23D8A95600B2AAD1 /* TextEntryFieldModel.swift in Sources */, @@ -2278,6 +2277,7 @@ 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, + AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */, BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */, D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */, 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index ab0d5b43..c5ea94d2 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -163,6 +163,7 @@ import Foundation // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Bill.self, viewModelClass: HeadersH1BillModel.self) // TODO: Need View try? ModelRegistry.register(TabsModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Bill.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Bill.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1BillModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1BillModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift From f0ec48a691d0542796831226fcbbb32b85c46ed8 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 28 Apr 2020 13:23:49 +0530 Subject: [PATCH 09/22] Code changes and renaming files after confluence update. --- MVMCoreUI.xcodeproj/project.pbxproj | 16 +++++------ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 2 +- ...swift => HeadersH1LandingPageHeader.swift} | 28 +++++++++---------- ... => HeadersH1LandingPageHeaderModel.swift} | 6 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{HeadersH1Bill.swift => HeadersH1LandingPageHeader.swift} (78%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{HeadersH1BillModel.swift => HeadersH1LandingPageHeaderModel.swift} (93%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 09269ac5..bd90b40d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -191,8 +191,8 @@ 94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; - AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */; }; - AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */; }; + AA104ADA244734DB004D2810 /* HeadersH1LandingPageHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */; }; + AA104ADC244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */; }; 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 */; }; @@ -647,8 +647,8 @@ 94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; - AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; - AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; + AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeader.swift; sourceTree = ""; }; + AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeaderModel.swift; 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 = ""; }; @@ -1055,8 +1055,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */, - AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */, + AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, + AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, ); path = Headers; sourceTree = ""; @@ -2283,7 +2283,7 @@ D2A92886241ACD99004E01C6 /* ProgrammaticTableViewController.swift in Sources */, BBAA4F05243D8E3B005AAD5F /* RadioBoxesModel.swift in Sources */, 01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */, - AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */, + AA104ADA244734DB004D2810 /* HeadersH1LandingPageHeader.swift in Sources */, 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */, D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */, 94F6516D2437954100631BF9 /* Tabs.swift in Sources */, @@ -2390,7 +2390,7 @@ 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, - AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */, + AA104ADC244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift in Sources */, BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */, D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */, 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 3c60b5c7..0207c6f6 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -169,7 +169,7 @@ import Foundation // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Bill.self, viewModelClass: HeadersH1BillModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1LandingPageHeader.self, viewModelClass: HeadersH1LandingPageHeaderModel.self) // Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift similarity index 78% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index 73879617..8ab212b3 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -1,5 +1,5 @@ // -// HeadersH1Bill.swift +// HeadersH1LandingPageHeader.swift // MVMCoreUI // // Created by Lekshmi S on 09/03/20. @@ -8,14 +8,14 @@ import Foundation -@objcMembers open class HeadersH1Bill: HeaderView { +@objcMembers open class HeadersH1LandingPageHeader: HeaderView { //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let headline = Label.commonLabelH1(true) - let headline2 = Label.commonLabelH1(true) - let subHeadline = Label.commonLabelB3(true) - let body = Label.commonLabelB2(true) + let headline = Label.createLabelTitle2XLarge(true) + let headline2 = Label.createLabelTitle2XLarge(true) + let subHeadline = Label.createLabelBoldBodySmall(true) + let body = Label.createLabelRegularBodySmall(true) let link = Link() let buttons = TwoButtonView(frame: .zero) var stack = Stack(frame: .zero) @@ -23,10 +23,10 @@ import Foundation //-------------------------------------------------- // MARK: - Constants //-------------------------------------------------- - let spacingBetweenHeadlineHeadline2: CGFloat = 9.0 - let spacingBetweenHeadlin2esubHeadline: CGFloat = 24.0 + let spacingBetweenHeadlineHeadline2: CGFloat = 16.0 + let spacingBetweenHeadlin2esubHeadline: CGFloat = 32.0 let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 - let spacingBetweenLinkButtons: CGFloat = 129.0 + let spacingBetweenLinkButtons: CGFloat = 128.0 //------------------------------------------------------- // MARK: - View Lifecycle @@ -44,7 +44,7 @@ import Foundation //------------------------------------------------------ open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.set(with: model, delegateObject, additionalData) - guard let model = model as? HeadersH1BillModel else { return } + guard let model = model as? HeadersH1LandingPageHeaderModel else { return } headline.set(with: model.headline, delegateObject, additionalData) headline2.set(with: model.headline2, delegateObject, additionalData) subHeadline.set(with: model.subHeadline, delegateObject, additionalData) @@ -59,10 +59,10 @@ import Foundation open override func reset() { super.reset() - headline.styleH1(true) - headline2.styleH1(true) - subHeadline.styleB3(true) - body.styleB2(true) + headline.styleTitle2XLarge(true) + headline2.styleTitle2XLarge(true) + subHeadline.styleBoldBodySmall(true) + body.styleRegularBodySmall(true) link.reset() buttons.reset() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeaderModel.swift similarity index 93% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeaderModel.swift index d901b38c..d7603886 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeaderModel.swift @@ -1,5 +1,5 @@ // -// HeadersH1BillModel.swift +// HeadersH1LandingPageHeaderModel.swift // MVMCoreUI // // Created by Lekshmi S on 09/03/20. @@ -8,11 +8,11 @@ import Foundation -public class HeadersH1BillModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH1LandingPageHeaderModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public static var identifier: String = "headerH1Bill" + public static var identifier: String = "headerH1Landing" public var headline: LabelModel public var headline2: LabelModel public var subHeadline: LabelModel From a32c46e432a42da8dbca046098dac450d2fdf8ce Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 28 Apr 2020 14:13:16 +0530 Subject: [PATCH 10/22] Code cleanup --- .../Headers/HeadersH1LandingPageHeader.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index 8ab212b3..ac09dc07 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -12,13 +12,13 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let headline = Label.createLabelTitle2XLarge(true) - let headline2 = Label.createLabelTitle2XLarge(true) - let subHeadline = Label.createLabelBoldBodySmall(true) - let body = Label.createLabelRegularBodySmall(true) - let link = Link() - let buttons = TwoButtonView(frame: .zero) - var stack = Stack(frame: .zero) + public let headline = Label.createLabelTitle2XLarge(true) + public let headline2 = Label.createLabelTitle2XLarge(true) + public let subHeadline = Label.createLabelBoldBodySmall(true) + public let body = Label.createLabelRegularBodySmall(true) + public let link = Link() + public let buttons = TwoButtonView(frame: .zero) + public var stack = Stack(frame: .zero) //-------------------------------------------------- // MARK: - Constants From a8051bf29e9271acd6e4f9bef51b1e917001d0ac Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 5 Jun 2020 15:51:34 +0530 Subject: [PATCH 11/22] Code cleanup --- .../DesignedComponents/Headers/HeadersH1LandingPageHeader.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index ac09dc07..388b70be 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -63,7 +63,5 @@ import Foundation headline2.styleTitle2XLarge(true) subHeadline.styleBoldBodySmall(true) body.styleRegularBodySmall(true) - link.reset() - buttons.reset() } } From b7f82ae29f4d3bde921136a3d76c1af03bb8987d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 5 Jun 2020 15:56:46 +0530 Subject: [PATCH 12/22] Model placed above view. --- MVMCoreUI.xcodeproj/project.pbxproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index deb3d015..a136a588 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -185,10 +185,10 @@ 94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; }; AA0A257824766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */; }; AA0A257A24766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */; }; - AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; - AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; AA104ADA244734DB004D2810 /* HeadersH1LandingPageHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */; }; AA104ADC244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */; }; + AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; + AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; 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 */; }; @@ -624,10 +624,10 @@ 94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = ""; }; AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyTextModel.swift; sourceTree = ""; }; AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyText.swift; sourceTree = ""; }; - AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; - AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = ""; }; AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeader.swift; sourceTree = ""; }; AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeaderModel.swift; sourceTree = ""; }; + AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; + AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; 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 = ""; }; @@ -1026,8 +1026,8 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, + AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, ); path = Headers; sourceTree = ""; From df4437a4bee26d5e4b97f36ce6e4d95e1ddad354 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 9 Jun 2020 18:03:39 +0530 Subject: [PATCH 13/22] Changes after latest style code and review comments. --- .../Headers/HeadersH1LandingPageHeader.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index 388b70be..bd37ed78 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -12,10 +12,10 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - public let headline = Label.createLabelTitle2XLarge(true) - public let headline2 = Label.createLabelTitle2XLarge(true) - public let subHeadline = Label.createLabelBoldBodySmall(true) - public let body = Label.createLabelRegularBodySmall(true) + public let headline = Label(fontStyle: .Title2XLarge) + public let headline2 = Label(fontStyle: .Title2XLarge) + public let subHeadline = Label(fontStyle: .BoldBodySmall) + public let body = Label(fontStyle: .RegularBodySmall) public let link = Link() public let buttons = TwoButtonView(frame: .zero) public var stack = Stack(frame: .zero) @@ -24,7 +24,7 @@ import Foundation // MARK: - Constants //-------------------------------------------------- let spacingBetweenHeadlineHeadline2: CGFloat = 16.0 - let spacingBetweenHeadlin2esubHeadline: CGFloat = 32.0 + let spacingBetweenHeadline2subHeadline: CGFloat = 32.0 let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 let spacingBetweenLinkButtons: CGFloat = 128.0 @@ -34,7 +34,7 @@ import Foundation open override func setupView() { super.setupView() stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadlin2esubHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons, horizontalAlignment: .leading))], axis: .vertical) + (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadline2subHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons))], axis: .vertical) addMolecule(stack) stack.restack() } @@ -59,9 +59,9 @@ import Foundation open override func reset() { super.reset() - headline.styleTitle2XLarge(true) - headline2.styleTitle2XLarge(true) - subHeadline.styleBoldBodySmall(true) - body.styleRegularBodySmall(true) + headline.setFontStyle(.Title2XLarge) + headline2.setFontStyle(.Title2XLarge) + subHeadline.setFontStyle(.BoldBodySmall) + body.setFontStyle(.RegularBodySmall) } } From fe12997456253e4b8d0a0eb6c1ac93e39a042618 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 11 Jun 2020 19:47:23 +0530 Subject: [PATCH 14/22] Code changes as per confluence updates. --- MVMCoreUI.xcodeproj/project.pbxproj | 10 ++++----- .../Headers/HeadersH1Button.swift | 22 ++++++++++++++----- .../Headers/HeadersH1ButtonModel.swift | 16 +++++++------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f85266b7..b4c341b7 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -187,10 +187,10 @@ 94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; }; AA0A257824766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */; }; AA0A257A24766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */; }; - AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; - AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC624472DB0004D2810 /* HeadersH1Button.swift */; }; AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */; }; + AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; + AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; 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 */; }; @@ -634,10 +634,10 @@ 94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = ""; }; AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyTextModel.swift; sourceTree = ""; }; AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyText.swift; sourceTree = ""; }; - AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; - AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = ""; }; AA104AC624472DB0004D2810 /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; + AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; + AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; 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 = ""; }; @@ -1042,8 +1042,8 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, ); path = Headers; sourceTree = ""; diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift index a7534e1a..eeddf714 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift @@ -12,16 +12,27 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let headlineBody = HeadlineBody(frame: .zero) - let button = PillButton(frame: .zero) - var stack = Stack(frame: .zero) + public let headlineBody = HeadlineBody(frame: .zero) + public let buttons = TwoButtonView(frame: .zero) + public let stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(frame: CGRect) { + stack = Stack.createStack(with: [headlineBody, buttons], spacing: PaddingVerticalWhiteGrayView) + super.init(frame: frame) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- open override func setupView() { super.setupView() - stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) headlineBody.styleLandingPageHeader() addMolecule(stack) stack.restack() @@ -34,7 +45,7 @@ import Foundation super.set(with: model, delegateObject, additionalData) guard let model = model as? HeadersH1ButtonModel else { return } headlineBody.set(with: model.headlineBody, delegateObject, additionalData) - button.set(with: model.button, delegateObject, additionalData) + buttons.set(with: model.buttons, delegateObject, additionalData) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { @@ -44,6 +55,5 @@ import Foundation open override func reset() { super.reset() headlineBody.styleLandingPageHeader() - button.reset() } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift index d008bab2..5df94b85 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift @@ -14,24 +14,24 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- public static var identifier: String = "headerH1Btn" public var headlineBody: HeadlineBodyModel - public var button: ButtonModel - + public var buttons: TwoButtonViewModel + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- - public init(headlineBody: HeadlineBodyModel, button: ButtonModel) { + public init(headlineBody: HeadlineBodyModel, buttons: TwoButtonViewModel) { self.headlineBody = headlineBody - self.button = button + self.buttons = buttons super.init() } - + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- private enum CodingKeys: String, CodingKey { case moleculeName case headlineBody - case button + case buttons } //-------------------------------------------------- @@ -40,7 +40,7 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) - button = try typeContainer.decode(ButtonModel.self, forKey: .button) + buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons) try super.init(from: decoder) } @@ -49,6 +49,6 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) try container.encode(headlineBody, forKey: .headlineBody) - try container.encode(button, forKey: .button) + try container.encode(buttons, forKey: .buttons) } } From e4436b4e29d457079ca9ebb3eb8bd62a3292b861 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 16 Jun 2020 19:42:16 +0530 Subject: [PATCH 15/22] 19223(iOS - Headers - H2 - Pricing - Two Rows) initial commit. Added model and molecule class files. --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Headers/HeadersH2PricingTwoRows.swift | 95 +++++++++++++++++++ .../HeadersH2PricingTwoRowsModel.swift | 90 ++++++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 3af65c10..9e306fad 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -201,6 +201,8 @@ AA56A211243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */; }; AA617AB02453010A00910B8F /* ListDeviceComplexLinkSmall.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA617AAF2453010A00910B8F /* ListDeviceComplexLinkSmall.swift */; }; AA617AB22453012400910B8F /* ListDeviceComplexLinkSmallModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA617AB12453012400910B8F /* ListDeviceComplexLinkSmallModel.swift */; }; + AA633B3124989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */; }; + AA633B3324989ED500731E80 /* HeadersH2PricingTwoRows.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */; }; AA69AAF62445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA69AAF52445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift */; }; AA69AAF82445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA69AAF72445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift */; }; AA7F32AB246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7F32AA246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift */; }; @@ -646,6 +648,8 @@ AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnSubsectionDivider.swift; sourceTree = ""; }; AA617AAF2453010A00910B8F /* ListDeviceComplexLinkSmall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListDeviceComplexLinkSmall.swift; sourceTree = ""; }; AA617AB12453012400910B8F /* ListDeviceComplexLinkSmallModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListDeviceComplexLinkSmallModel.swift; sourceTree = ""; }; + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2PricingTwoRowsModel.swift; sourceTree = ""; }; + AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2PricingTwoRows.swift; sourceTree = ""; }; AA69AAF52445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxBodyText.swift; sourceTree = ""; }; AA69AAF72445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxBodyTextModel.swift; sourceTree = ""; }; AA7F32AA246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAllTextAndLinksModel.swift; sourceTree = ""; }; @@ -1038,6 +1042,8 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, + AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */, ); path = Headers; sourceTree = ""; @@ -2217,6 +2223,7 @@ 0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */, D264FA8E243BCD9A00D98315 /* CollectionTemplate.swift in Sources */, 0A7EF85B23D8A52800B2AAD1 /* EntryFieldModel.swift in Sources */, + AA633B3124989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift in Sources */, 8DEFA95C243DAC20000D27E5 /* ListThreeColumnDataUsageDividerModel.swift in Sources */, D2092357244FA1EF0044AD09 /* ThreeLayerModelBase.swift in Sources */, 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */, @@ -2433,6 +2440,7 @@ 0A25209824645B76000FA9F6 /* TextViewEntryFieldModel.swift in Sources */, 525019DD2406430800EED91C /* ListProgressBarDataModel.swift in Sources */, C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */, + AA633B3324989ED500731E80 /* HeadersH2PricingTwoRows.swift in Sources */, 01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */, 0A6682A22434DB4F00AD3CA1 /* ListLeftVariableRadioButtonBodyText.swift in Sources */, EA5124FD243601600051A3A4 /* BGImageHeadlineBodyButton.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 98b1e6a3..2c5f54e6 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -206,6 +206,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Buttons.self, viewModelClass: HeadersH2ButtonsModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2PricingTwoRows.self, viewModelClass: HeadersH2PricingTwoRowsModel.self) // Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift new file mode 100644 index 00000000..9d861fe2 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift @@ -0,0 +1,95 @@ +// +// HeadersH2PricingTwoRows.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH2PricingTwoRows: HeaderView { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + public let headline = Label(fontStyle: .H2) + public let body = Label(fontStyle: .B2) + public let subBody = Label(fontStyle: .B3) + public let body2 = Label(fontStyle: .B2) + public let subBody2 = Label(fontStyle: .B3) + public let body3 = Label(fontStyle: .B2) + public let subBody3 = Label(fontStyle: .B3) + public let verticalLine1 = Line() + public let verticalLine2 = Line() + public let verticalStack1: Stack + public let verticalStack2: Stack + public let verticalStack3: Stack + public let horizontalStack: Stack + public let stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(frame: CGRect) { + verticalStack1 = Stack.createStack(with: [body, subBody], spacing: 0) + verticalStack2 = Stack.createStack(with: [body2, subBody2], spacing: 0) + verticalStack3 = Stack.createStack(with: [body3, subBody3], spacing: 0) + horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 29, horizontalAlignment: .leading, verticalAlignment: .top)), (view: verticalLine1, model: StackItemModel(percent: 2, verticalAlignment: .top)), + (view: verticalStack2, model: StackItemModel(percent: 33, horizontalAlignment: .center, verticalAlignment: .top)), + (view: verticalLine2, model: StackItemModel(percent: 2, verticalAlignment: .top)), + (view: verticalStack3, model: StackItemModel(percent: 34, horizontalAlignment: .center, verticalAlignment: .top))], + axis: .horizontal) + stack = Stack.createStack(with: [headline, horizontalStack], spacing: 8) + super.init(frame: frame) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //------------------------------------------------------- + // MARK: - Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + verticalLine1.widthConstraint?.isActive = true + verticalLine1.backgroundColor = .mvmBlack + verticalLine1.heightConstraint?.constant = 13 + verticalLine2.widthConstraint?.isActive = true + verticalLine2.backgroundColor = .mvmBlack + verticalLine2.heightConstraint?.constant = 13 + addMolecule(stack) + stack.restack() + verticalStack1.restack() + verticalStack2.restack() + verticalStack3.restack() + horizontalStack.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? HeadersH2PricingTwoRowsModel else { return } + headline.set(with: model.headline, delegateObject, additionalData) + verticalStack1.updateContainedMolecules(with: [model.body, model.subBody], delegateObject, additionalData) + verticalStack2.updateContainedMolecules(with: [model.body2, model.subBody2], delegateObject, additionalData) + verticalStack3.updateContainedMolecules(with: [model.body3, model.subBody3], delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headline.setFontStyle(.H2) + body.setFontStyle(.B2) + subBody.setFontStyle(.B3) + body2.setFontStyle(.B2) + subBody2.setFontStyle(.B3) + body3.setFontStyle(.B2) + subBody3.setFontStyle(.B3) + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift new file mode 100644 index 00000000..6991bf03 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift @@ -0,0 +1,90 @@ +// +// HeadersH2PricingTwoRowsModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + public static var identifier: String = "headerH2TwoRows" + public var headline: LabelModel + public var body: LabelModel + public var subBody: LabelModel? + public var body2: LabelModel + public var subBody2: LabelModel? + public var body3: LabelModel + public var subBody3: LabelModel? + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headline: LabelModel, body: LabelModel, subBody: LabelModel? = nil, body2: LabelModel, subBody2: LabelModel? = nil, body3: LabelModel, subBody3: LabelModel? = nil) { + self.headline = headline + self.body = body + self.subBody = subBody + self.body2 = body2 + self.subBody2 = subBody2 + self.body3 = body3 + self.subBody3 = subBody3 + super.init() + } + + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + public override func setDefaults() { + super.setDefaults() + body.hero = 0 + subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] + subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] + subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case headline + case body + case subBody + case body2 + case subBody2 + case body3 + case subBody3 + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + subBody = try typeContainer.decode(LabelModel.self, forKey: .subBody) + body2 = try typeContainer.decode(LabelModel.self, forKey: .body2) + subBody2 = try typeContainer.decode(LabelModel.self, forKey: .subBody2) + body3 = try typeContainer.decode(LabelModel.self, forKey: .body3) + subBody3 = try typeContainer.decode(LabelModel.self, forKey: .subBody3) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headline, forKey: .headline) + try container.encode(body, forKey: .body) + try container.encode(subBody, forKey: .subBody) + try container.encode(body2, forKey: .body2) + try container.encode(subBody2, forKey: .subBody2) + try container.encode(body3, forKey: .body3) + try container.encode(subBody3, forKey: .subBody3) + } +} From 1e724cc7ab5f9218f10bca41681814f5874c5c9f Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 19 Jun 2020 16:01:00 -0400 Subject: [PATCH 16/22] update default values --- MVMCoreUI/BaseControllers/ViewController.swift | 2 +- ...VMCoreUISplitViewController+Extension.swift | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 3a7bc962..6e1b35ff 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -197,7 +197,7 @@ import UIKit navigationItem.leftItemsSupplementBackButton = true // Utilize helper function to set the split view and navigation item state. - MVMCoreUISplitViewController.setSplitViewController(for: viewController, navigationController: navigationController, navigationItemModel: navigationItemModel, leftPanelAccessible: isMasterInitiallyAccessible(), rightPanelAccessible: isSupportInitiallyAccessible(), progress: bottomProgress()) + MVMCoreUISplitViewController.setSplitViewController(for: viewController, navigationController: navigationController, navigationItemModel: navigationItemModel, leftPanelAccessible: isMasterInitiallyAccessible(), rightPanelAccessible: isSupportInitiallyAccessible(), progress: bottomProgress() ?? 0) } // Eventually will be moved to server diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift index ed4f931c..bfbe19ac 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift @@ -10,8 +10,8 @@ import Foundation public extension MVMCoreUISplitViewController { - /// Convenience function. Sets the navigation and split view properties for the view controller. - static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: Float? = nil) { + /// Convenience function. Sets the navigation and split view properties for the view controller. Optional parameters use current value if not set. + static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool? = nil, rightPanelAccessible: Bool? = nil, progress: Float? = nil) { guard let splitView = MVMCoreUISplitViewController.main(), navigationController == splitView.navigationController, navigationController.topViewController == viewController else { @@ -22,22 +22,24 @@ public extension MVMCoreUISplitViewController { } /// Sets the navigation item for the view controller based on the model and splitview controller - func set(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: Float? = nil) { + func set(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool? = nil, rightPanelAccessible: Bool? = nil, progress: Float? = nil) { // Setup the panels. - MVMCoreUISession.sharedGlobal()?.splitViewController?.setupPanels() + setupPanels() NavigationController.setNavigationUI(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) - MVMCoreUISplitViewController.main()?.setLeftPanelIsAccessible(leftPanelAccessible, for: viewController, updateNavigationButtons: false) - MVMCoreUISplitViewController.main()?.setRightPanelIsAccessible(rightPanelAccessible, for: viewController, updateNavigationButtons: false) + setLeftPanelIsAccessible(leftPanelAccessible ?? leftPanelIsAccessible, for: viewController, updateNavigationButtons: false) + setRightPanelIsAccessible(rightPanelAccessible ?? rightPanelIsAccessible, for: viewController, updateNavigationButtons: false) setLeftNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) setRightNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) - MVMCoreUISession.sharedGlobal()?.splitViewController?.setNavigationIconColor(navigationItemModel.tintColor.uiColor) + setNavigationIconColor(navigationItemModel.tintColor.uiColor) - setBottomProgressBarProgress(progress ?? 0) + if let progress = progress { + setBottomProgressBarProgress(progress) + } } /// Sets the left navigation items for the view controller based on model and splitview. From 65fcdb8be06437971a28175bec9fa7dcdbc6ce9b Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 11:06:38 -0400 Subject: [PATCH 17/22] minor organizing --- MVMCoreUI.xcodeproj/project.pbxproj | 32 ++++++++++++++----- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 2 +- .../Headers/{ => H1}/HeadersH1Button.swift | 2 +- .../{ => H1}/HeadersH1ButtonModel.swift | 0 .../Headers/{ => H2}/HeadersH2Buttons.swift | 0 .../{ => H2}/HeadersH2ButtonsModel.swift | 0 .../{ => H2}/HeadersH2NoButtonsBodyText.swift | 0 .../HeadersH2NoButtonsBodyTextModel.swift | 0 .../{ => H2}/HeadersH2TinyButton.swift | 0 .../{ => H2}/HeadersH2TinyButtonModel.swift | 0 10 files changed, 26 insertions(+), 10 deletions(-) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H1}/HeadersH1Button.swift (97%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H1}/HeadersH1ButtonModel.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2Buttons.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2ButtonsModel.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2NoButtonsBodyText.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2NoButtonsBodyTextModel.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2TinyButton.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2TinyButtonModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 3564829c..7f1edb59 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -1040,14 +1040,8 @@ 5206F150241144A900658DC5 /* Headers */ = { isa = PBXGroup; children = ( - AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, - AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */, - AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, - AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, - AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, - AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, + D287955224A2504C0056BF75 /* H1 */, + D287955324A250550056BF75 /* H2 */, ); path = Headers; sourceTree = ""; @@ -1493,6 +1487,28 @@ path = Selectors; sourceTree = ""; }; + D287955224A2504C0056BF75 /* H1 */ = { + isa = PBXGroup; + children = ( + AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, + ); + path = H1; + sourceTree = ""; + }; + D287955324A250550056BF75 /* H2 */ = { + isa = PBXGroup; + children = ( + AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, + AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */, + AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, + AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, + AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, + ); + path = H2; + sourceTree = ""; + }; D29DF0C221E404D4003B2FB9 = { isa = PBXGroup; children = ( diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index f2a1901a..c8677ba1 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -204,10 +204,10 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnDataUsageDivider.self, viewModelClass: ListThreeColumnDataUsageDividerModel.self) // Designed Headers + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Buttons.self, viewModelClass: HeadersH2ButtonsModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1Button.swift similarity index 97% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1Button.swift index eeddf714..d41b9022 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1Button.swift @@ -20,7 +20,7 @@ import Foundation // MARK: - Initializers //------------------------------------------------------- public override init(frame: CGRect) { - stack = Stack.createStack(with: [headlineBody, buttons], spacing: PaddingVerticalWhiteGrayView) + stack = Stack.createStack(with: [headlineBody, buttons], spacing: Padding.Eighteen) super.init(frame: frame) } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2Buttons.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Buttons.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2Buttons.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Buttons.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2ButtonsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2ButtonsModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyText.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyText.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButton.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButton.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift From a5e6941c30d6c99c44164f79d4e5482d5ece641e Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:12:02 -0400 Subject: [PATCH 18/22] re-arrage code --- .../Headers/H2/HeadersH2PricingTwoRows.swift | 121 ++++++++++++++++++ .../H2/HeadersH2PricingTwoRowsModel.swift | 89 +++++++++++++ 2 files changed, 210 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift new file mode 100644 index 00000000..12097880 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift @@ -0,0 +1,121 @@ +// +// HeadersH2PricingTwoRows.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH2PricingTwoRows: HeaderView { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + public let headline = Label(fontStyle: .RegularTitleLarge) + public let body = Label(fontStyle: .RegularMicro) + public let subBody = Label(fontStyle: .RegularMicro) + public let body2 = Label(fontStyle: .RegularMicro) + public let subBody2 = Label(fontStyle: .RegularMicro) + public let body3 = Label(fontStyle: .RegularMicro) + public let subBody3 = Label(fontStyle: .RegularMicro) + public let verticalLine1 = Line() + public let verticalLine2 = Line() + public let verticalStack1: Stack + public let verticalStack2: Stack + public let verticalStack3: Stack + public let horizontalStack: Stack + public let stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(frame: CGRect) { + verticalStack1 = Stack.createStack(with: [body, subBody], spacing: 0) + verticalStack2 = Stack.createStack(with: [body2, subBody2], spacing: 0) + verticalStack3 = Stack.createStack(with: [body3, subBody3], spacing: 0) + horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 29, verticalAlignment: .top)), (view: verticalLine1, model: StackItemModel(verticalAlignment: .top)), + (view: verticalStack2, model: StackItemModel(horizontalAlignment: .leading, verticalAlignment: .top)), + (view: verticalLine2, model: StackItemModel(verticalAlignment: .top)), + (view: verticalStack3, model: StackItemModel(percent: 32, verticalAlignment: .top))], + axis: .horizontal) + stack = Stack.createStack(with: [headline, horizontalStack], spacing: 8) + super.init(frame: frame) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //------------------------------------------------------- + // MARK: - Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + setDefaults() + body.numberOfLines = 1 + body.lineBreakMode = .byTruncatingTail + body2.numberOfLines = 1 + body2.lineBreakMode = .byTruncatingTail + body3.numberOfLines = 1 + body3.lineBreakMode = .byTruncatingTail + + verticalLine1.widthConstraint?.isActive = true + verticalLine1.backgroundColor = .mvmBlack + verticalLine2.widthConstraint?.isActive = true + verticalLine2.backgroundColor = .mvmBlack + + addMolecule(stack) + stack.restack() + verticalStack1.restack() + verticalStack2.restack() + verticalStack3.restack() + horizontalStack.restack() + setLineHeight() + } + + open func setDefaults() { + headline.setFontStyle(.BoldTitleLarge) + body.setFontStyle(.RegularMicro) + subBody.setFontStyle(.RegularMicro) + body2.setFontStyle(.RegularMicro) + subBody2.setFontStyle(.RegularMicro) + body3.setFontStyle(.RegularMicro) + subBody3.setFontStyle(.RegularMicro) + subBody.textColor = .mvmCoolGray6 + subBody2.textColor = .mvmCoolGray6 + subBody3.textColor = .mvmCoolGray6 + } + + open func setLineHeight() { + verticalLine1.heightConstraint?.isActive = false + verticalLine1.heightConstraint = verticalLine1.heightAnchor.constraint(equalTo: body2.heightAnchor, multiplier: 1) + verticalLine1.heightConstraint?.isActive = true + + verticalLine2.heightConstraint?.isActive = false + verticalLine2.heightConstraint = verticalLine2.heightAnchor.constraint(equalTo: body3.heightAnchor, multiplier: 1) + verticalLine2.heightConstraint?.isActive = true + } + + //---------------------------------------------------- + // 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? HeadersH2PricingTwoRowsModel else { return } + headline.set(with: model.headline, delegateObject, additionalData) + verticalStack1.updateContainedMolecules(with: [model.body, model.subBody], delegateObject, additionalData) + verticalStack2.updateContainedMolecules(with: [model.body2, model.subBody2], delegateObject, additionalData) + verticalStack3.updateContainedMolecules(with: [model.body3, model.subBody3], delegateObject, additionalData) + setLineHeight() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + setDefaults() + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift new file mode 100644 index 00000000..219f539f --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift @@ -0,0 +1,89 @@ +// +// HeadersH2PricingTwoRowsModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + public static var identifier: String = "headerH2TwoRows" + public var headline: LabelModel + public var body: LabelModel + public var subBody: LabelModel? + public var body2: LabelModel + public var subBody2: LabelModel? + public var body3: LabelModel + public var subBody3: LabelModel? + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headline: LabelModel, body: LabelModel, subBody: LabelModel? = nil, body2: LabelModel, subBody2: LabelModel? = nil, body3: LabelModel, subBody3: LabelModel? = nil) { + self.headline = headline + self.body = body + self.subBody = subBody + self.body2 = body2 + self.subBody2 = subBody2 + self.body3 = body3 + self.subBody3 = subBody3 + super.init() + } + + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + public override func setDefaults() { + super.setDefaults() + subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] + subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] + subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case headline + case body + case subBody + case body2 + case subBody2 + case body3 + case subBody3 + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + subBody = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .subBody) + body2 = try typeContainer.decode(LabelModel.self, forKey: .body2) + subBody2 = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .subBody2) + body3 = try typeContainer.decode(LabelModel.self, forKey: .body3) + subBody3 = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .subBody3) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headline, forKey: .headline) + try container.encode(body, forKey: .body) + try container.encodeIfPresent(subBody, forKey: .subBody) + try container.encode(body2, forKey: .body2) + try container.encodeIfPresent(subBody2, forKey: .subBody2) + try container.encode(body3, forKey: .body3) + try container.encodeIfPresent(subBody3, forKey: .subBody3) + } +} From 384158e8556dce41f6a2b635f070044831ceb8c6 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:13:19 -0400 Subject: [PATCH 19/22] align --- MVMCoreUI.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index afac04c7..d483d10c 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -1511,7 +1511,7 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */, ); path = H2; From 3add9702c68505f55b3bb783c5d172954dd464e8 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:14:10 -0400 Subject: [PATCH 20/22] move files --- .../Headers/HeadersH2PricingTwoRows.swift | 95 ------------------- 1 file changed, 95 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift deleted file mode 100644 index 9d861fe2..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// HeadersH2PricingTwoRows.swift -// MVMCoreUI -// -// Created by Lekshmi S on 16/06/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers open class HeadersH2PricingTwoRows: HeaderView { - //-------------------------------------------------- - // MARK: - Outlets - //-------------------------------------------------- - public let headline = Label(fontStyle: .H2) - public let body = Label(fontStyle: .B2) - public let subBody = Label(fontStyle: .B3) - public let body2 = Label(fontStyle: .B2) - public let subBody2 = Label(fontStyle: .B3) - public let body3 = Label(fontStyle: .B2) - public let subBody3 = Label(fontStyle: .B3) - public let verticalLine1 = Line() - public let verticalLine2 = Line() - public let verticalStack1: Stack - public let verticalStack2: Stack - public let verticalStack3: Stack - public let horizontalStack: Stack - public let stack: Stack - - //------------------------------------------------------- - // MARK: - Initializers - //------------------------------------------------------- - public override init(frame: CGRect) { - verticalStack1 = Stack.createStack(with: [body, subBody], spacing: 0) - verticalStack2 = Stack.createStack(with: [body2, subBody2], spacing: 0) - verticalStack3 = Stack.createStack(with: [body3, subBody3], spacing: 0) - horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 29, horizontalAlignment: .leading, verticalAlignment: .top)), (view: verticalLine1, model: StackItemModel(percent: 2, verticalAlignment: .top)), - (view: verticalStack2, model: StackItemModel(percent: 33, horizontalAlignment: .center, verticalAlignment: .top)), - (view: verticalLine2, model: StackItemModel(percent: 2, verticalAlignment: .top)), - (view: verticalStack3, model: StackItemModel(percent: 34, horizontalAlignment: .center, verticalAlignment: .top))], - axis: .horizontal) - stack = Stack.createStack(with: [headline, horizontalStack], spacing: 8) - super.init(frame: frame) - } - - public required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - //------------------------------------------------------- - // MARK: - Lifecycle - //------------------------------------------------------- - open override func setupView() { - super.setupView() - verticalLine1.widthConstraint?.isActive = true - verticalLine1.backgroundColor = .mvmBlack - verticalLine1.heightConstraint?.constant = 13 - verticalLine2.widthConstraint?.isActive = true - verticalLine2.backgroundColor = .mvmBlack - verticalLine2.heightConstraint?.constant = 13 - addMolecule(stack) - stack.restack() - verticalStack1.restack() - verticalStack2.restack() - verticalStack3.restack() - horizontalStack.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? HeadersH2PricingTwoRowsModel else { return } - headline.set(with: model.headline, delegateObject, additionalData) - verticalStack1.updateContainedMolecules(with: [model.body, model.subBody], delegateObject, additionalData) - verticalStack2.updateContainedMolecules(with: [model.body2, model.subBody2], delegateObject, additionalData) - verticalStack3.updateContainedMolecules(with: [model.body3, model.subBody3], delegateObject, additionalData) - } - - open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 121 - } - - open override func reset() { - super.reset() - headline.setFontStyle(.H2) - body.setFontStyle(.B2) - subBody.setFontStyle(.B3) - body2.setFontStyle(.B2) - subBody2.setFontStyle(.B3) - body3.setFontStyle(.B2) - subBody3.setFontStyle(.B3) - } -} From 17af164cd9a6c2b52e841ed39cb16cefac46854b Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:14:37 -0400 Subject: [PATCH 21/22] move files --- .../HeadersH2PricingTwoRowsModel.swift | 90 ------------------- 1 file changed, 90 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift deleted file mode 100644 index 6991bf03..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift +++ /dev/null @@ -1,90 +0,0 @@ -// -// HeadersH2PricingTwoRowsModel.swift -// MVMCoreUI -// -// Created by Lekshmi S on 16/06/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - public static var identifier: String = "headerH2TwoRows" - public var headline: LabelModel - public var body: LabelModel - public var subBody: LabelModel? - public var body2: LabelModel - public var subBody2: LabelModel? - public var body3: LabelModel - public var subBody3: LabelModel? - - //-------------------------------------------------- - // MARK: - Initializer - //-------------------------------------------------- - public init(headline: LabelModel, body: LabelModel, subBody: LabelModel? = nil, body2: LabelModel, subBody2: LabelModel? = nil, body3: LabelModel, subBody3: LabelModel? = nil) { - self.headline = headline - self.body = body - self.subBody = subBody - self.body2 = body2 - self.subBody2 = subBody2 - self.body3 = body3 - self.subBody3 = subBody3 - super.init() - } - - //-------------------------------------------------- - // MARK: - Methods - //-------------------------------------------------- - public override func setDefaults() { - super.setDefaults() - body.hero = 0 - subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] - subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] - subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] - } - - //-------------------------------------------------- - // MARK: - Keys - //-------------------------------------------------- - private enum CodingKeys: String, CodingKey { - case moleculeName - case headline - case body - case subBody - case body2 - case subBody2 - case body3 - case subBody3 - } - - //-------------------------------------------------- - // MARK: - Codec - //-------------------------------------------------- - required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - headline = try typeContainer.decode(LabelModel.self, forKey: .headline) - body = try typeContainer.decode(LabelModel.self, forKey: .body) - subBody = try typeContainer.decode(LabelModel.self, forKey: .subBody) - body2 = try typeContainer.decode(LabelModel.self, forKey: .body2) - subBody2 = try typeContainer.decode(LabelModel.self, forKey: .subBody2) - body3 = try typeContainer.decode(LabelModel.self, forKey: .body3) - subBody3 = try typeContainer.decode(LabelModel.self, forKey: .subBody3) - try super.init(from: decoder) - } - - public override func encode(to encoder: Encoder) throws { - try super.encode(to: encoder) - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(moleculeName, forKey: .moleculeName) - try container.encode(headline, forKey: .headline) - try container.encode(body, forKey: .body) - try container.encode(subBody, forKey: .subBody) - try container.encode(body2, forKey: .body2) - try container.encode(subBody2, forKey: .subBody2) - try container.encode(body3, forKey: .body3) - try container.encode(subBody3, forKey: .subBody3) - } -} From 57dcdfea9cb0a5a6d2b4bb00e4d81c335451226a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 13:17:51 -0400 Subject: [PATCH 22/22] only allocate stack once. --- .../Headers/H1/HeadersH1LandingPageHeader.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift index bd37ed78..c78ada3f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift @@ -18,7 +18,7 @@ import Foundation public let body = Label(fontStyle: .RegularBodySmall) public let link = Link() public let buttons = TwoButtonView(frame: .zero) - public var stack = Stack(frame: .zero) + public var stack: Stack! //-------------------------------------------------- // MARK: - Constants @@ -33,8 +33,12 @@ import Foundation //------------------------------------------------------- open override func setupView() { super.setupView() - stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadline2subHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons))], axis: .vertical) + stack = Stack.createStack(with: [(view: headline, model: StackItemModel()), + (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2)), + (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadline2subHeadline)), + (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink)), + (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), + (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons))]) addMolecule(stack) stack.restack() }