From 12d8520e424ce05a68360684fcfea755d5870914 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Mon, 9 Mar 2020 13:24:48 +0530 Subject: [PATCH 1/9] 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 5eb396092674ddf3a4f43a46c757770473ab3324 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 18 Mar 2020 16:49:45 +0530 Subject: [PATCH 2/9] 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 9760953004358838c3c9a76fb51bf2b522a4829d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 15 Apr 2020 18:00:14 +0530 Subject: [PATCH 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 57dcdfea9cb0a5a6d2b4bb00e4d81c335451226a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 13:17:51 -0400 Subject: [PATCH 9/9] 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() }