From 131603a5eeae03d48cdfbd22343ec3bd0f67cf0a Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 14 Jul 2020 10:49:56 +0530 Subject: [PATCH 01/17] Initial commit MOBFIRST - 21714 --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ .../Headers/H1/HeadersH1NoButton.swift | 9 ++++ .../Headers/H1/HeadersH1NoButtonModel.swift | 51 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 65c0e81d..2f09db0f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -121,6 +121,8 @@ 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; }; 324FB6AA249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324FB6A9249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift */; }; 324FB6AC24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324FB6AB24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift */; }; + 3265B30224BCA737000D154B /* HeadersH1NoButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3265B30124BCA737000D154B /* HeadersH1NoButtonModel.swift */; }; + 3265B30424BCA749000D154B /* HeadersH1NoButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3265B30324BCA749000D154B /* HeadersH1NoButton.swift */; }; 32F8804624765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F8804524765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift */; }; 32F8804824765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F8804724765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift */; }; 522679C123FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */; }; @@ -584,6 +586,8 @@ 31BE15CA23D8924C00452370 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = ""; }; 324FB6A9249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListBodyTextModel.swift; sourceTree = ""; }; 324FB6AB24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListBodyText.swift; sourceTree = ""; }; + 3265B30124BCA737000D154B /* HeadersH1NoButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1NoButtonModel.swift; sourceTree = ""; }; + 3265B30324BCA749000D154B /* HeadersH1NoButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1NoButton.swift; sourceTree = ""; }; 32F8804524765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListAllTextAndLinksModel.swift; sourceTree = ""; }; 32F8804724765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListAllTextAndLinks.swift; sourceTree = ""; }; 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxAllTextAndLinks.swift; sourceTree = ""; }; @@ -1524,6 +1528,8 @@ AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, + 3265B30124BCA737000D154B /* HeadersH1NoButtonModel.swift */, + 3265B30324BCA749000D154B /* HeadersH1NoButton.swift */, ); path = H1; sourceTree = ""; @@ -2148,6 +2154,7 @@ D264FAAA2440F97600D98315 /* CollectionView.swift in Sources */, BBC0C4FF24811DCA0087C44F /* TagModel.swift in Sources */, 0A7BAD74232A8DC700FB8E22 /* HeadlineBodyButton.swift in Sources */, + 3265B30424BCA749000D154B /* HeadersH1NoButton.swift in Sources */, D2FB151D23A40F1500C20E10 /* MoleculeStackItem.swift in Sources */, D28BA7452481652D00B75CB8 /* TabBarProtocol.swift in Sources */, AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */, @@ -2368,6 +2375,7 @@ D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */, 526A265E240D200500B0D828 /* ListTwoColumnCompareChanges.swift in Sources */, 8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */, + 3265B30224BCA737000D154B /* HeadersH1NoButtonModel.swift in Sources */, D28A838F23CCDEDE00DFE4FC /* TwoButtonViewModel.swift in Sources */, D264FAAC2441009400D98315 /* RadioBoxCollectionViewCell.swift in Sources */, BB2C969224330F73006FF80C /* ListRightVariableTextLinkAllTextAndLinks.swift in Sources */, diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift new file mode 100644 index 00000000..095d3184 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift @@ -0,0 +1,9 @@ +// +// HeadersH1NoButton.swift +// MVMCoreUI +// +// Created by Subhankar Acharya on 13/07/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonModel.swift new file mode 100644 index 00000000..e4234232 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonModel.swift @@ -0,0 +1,51 @@ +// +// HeadersH1NoButtonModel.swift +// MVMCoreUI +// +// Created by Subhankar Acharya on 13/07/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +import Foundation + +public class HeadersH1NoButtonModel: HeaderModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + public static var identifier: String = "headerH1" + public var headlineBody: HeadlineBodyModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headlineBody: HeadlineBodyModel, buttons: TwoButtonViewModel) { + self.headlineBody = headlineBody + super.init() + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case headlineBody + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + 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(headlineBody, forKey: .headlineBody) + } +} From 5644442dcccd46945781d960ce78bed6d75bf30a Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 14 Jul 2020 13:49:52 +0530 Subject: [PATCH 02/17] Changes in class and code file names --- MVMCoreUI.xcodeproj/project.pbxproj | 16 +++---- .../Headers/H1/HeadersH1NoButton.swift | 9 ---- .../H1/HeadersH1NoButtonsBodyText.swift | 43 +++++++++++++++++++ ... => HeadersH1NoButtonsBodyTextModel.swift} | 6 +-- 4 files changed, 53 insertions(+), 21 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/{HeadersH1NoButtonModel.swift => HeadersH1NoButtonsBodyTextModel.swift} (92%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 2f09db0f..db3507c3 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -121,8 +121,8 @@ 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; }; 324FB6AA249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324FB6A9249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift */; }; 324FB6AC24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324FB6AB24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift */; }; - 3265B30224BCA737000D154B /* HeadersH1NoButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3265B30124BCA737000D154B /* HeadersH1NoButtonModel.swift */; }; - 3265B30424BCA749000D154B /* HeadersH1NoButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3265B30324BCA749000D154B /* HeadersH1NoButton.swift */; }; + 3265B30224BCA737000D154B /* HeadersH1NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3265B30124BCA737000D154B /* HeadersH1NoButtonsBodyTextModel.swift */; }; + 3265B30424BCA749000D154B /* HeadersH1NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3265B30324BCA749000D154B /* HeadersH1NoButtonsBodyText.swift */; }; 32F8804624765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F8804524765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift */; }; 32F8804824765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F8804724765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift */; }; 522679C123FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */; }; @@ -586,8 +586,8 @@ 31BE15CA23D8924C00452370 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = ""; }; 324FB6A9249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListBodyTextModel.swift; sourceTree = ""; }; 324FB6AB24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListBodyText.swift; sourceTree = ""; }; - 3265B30124BCA737000D154B /* HeadersH1NoButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1NoButtonModel.swift; sourceTree = ""; }; - 3265B30324BCA749000D154B /* HeadersH1NoButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1NoButton.swift; sourceTree = ""; }; + 3265B30124BCA737000D154B /* HeadersH1NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1NoButtonsBodyTextModel.swift; sourceTree = ""; }; + 3265B30324BCA749000D154B /* HeadersH1NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1NoButtonsBodyText.swift; sourceTree = ""; }; 32F8804524765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListAllTextAndLinksModel.swift; sourceTree = ""; }; 32F8804724765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListAllTextAndLinks.swift; sourceTree = ""; }; 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxAllTextAndLinks.swift; sourceTree = ""; }; @@ -1528,8 +1528,8 @@ AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, - 3265B30124BCA737000D154B /* HeadersH1NoButtonModel.swift */, - 3265B30324BCA749000D154B /* HeadersH1NoButton.swift */, + 3265B30124BCA737000D154B /* HeadersH1NoButtonsBodyTextModel.swift */, + 3265B30324BCA749000D154B /* HeadersH1NoButtonsBodyText.swift */, ); path = H1; sourceTree = ""; @@ -2154,7 +2154,7 @@ D264FAAA2440F97600D98315 /* CollectionView.swift in Sources */, BBC0C4FF24811DCA0087C44F /* TagModel.swift in Sources */, 0A7BAD74232A8DC700FB8E22 /* HeadlineBodyButton.swift in Sources */, - 3265B30424BCA749000D154B /* HeadersH1NoButton.swift in Sources */, + 3265B30424BCA749000D154B /* HeadersH1NoButtonsBodyText.swift in Sources */, D2FB151D23A40F1500C20E10 /* MoleculeStackItem.swift in Sources */, D28BA7452481652D00B75CB8 /* TabBarProtocol.swift in Sources */, AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */, @@ -2375,7 +2375,7 @@ D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */, 526A265E240D200500B0D828 /* ListTwoColumnCompareChanges.swift in Sources */, 8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */, - 3265B30224BCA737000D154B /* HeadersH1NoButtonModel.swift in Sources */, + 3265B30224BCA737000D154B /* HeadersH1NoButtonsBodyTextModel.swift in Sources */, D28A838F23CCDEDE00DFE4FC /* TwoButtonViewModel.swift in Sources */, D264FAAC2441009400D98315 /* RadioBoxCollectionViewCell.swift in Sources */, BB2C969224330F73006FF80C /* ListRightVariableTextLinkAllTextAndLinks.swift in Sources */, diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift deleted file mode 100644 index 095d3184..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButton.swift +++ /dev/null @@ -1,9 +0,0 @@ -// -// HeadersH1NoButton.swift -// MVMCoreUI -// -// Created by Subhankar Acharya on 13/07/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift new file mode 100644 index 00000000..d542960d --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift @@ -0,0 +1,43 @@ +// +// HeadersH1NoButtonsBodyText.swift +// MVMCoreUI +// +// Created by Subhankar Acharya on 13/07/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH1NoButtonsBodyText: HeaderView { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + public let headlineBody = HeadlineBody(frame: .zero) + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + headlineBody.styleLandingPageHeader() + addMolecule(headlineBody) + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? HeadersH1ButtonModel else { return } + headlineBody.set(with: model.headlineBody, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headlineBody.styleLandingPageHeader() + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift similarity index 92% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift index e4234232..fa0ab6c5 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift @@ -1,5 +1,5 @@ // -// HeadersH1NoButtonModel.swift +// HeadersH1NoButtonsBodyTextModel.swift // MVMCoreUI // // Created by Subhankar Acharya on 13/07/20. @@ -8,9 +8,7 @@ import Foundation -import Foundation - -public class HeadersH1NoButtonModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- From 139f019ea1efa1104a3f3cfad58f9c1e8c0d26db Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 14 Jul 2020 13:53:16 +0530 Subject: [PATCH 03/17] Added model registry --- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 5a3a3a1f..40808777 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -208,6 +208,7 @@ import Foundation // MARK:- Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1LandingPageHeader.self, viewModelClass: HeadersH1LandingPageHeaderModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1NoButtonsBodyText.self, viewModelClass: HeadersH1NoButtonsBodyTextModel.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) From 63a387a4e116146f101a1cae9c711e1a305cecd6 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 14 Jul 2020 16:01:54 +0530 Subject: [PATCH 04/17] code change --- .../Headers/H1/HeadersH1NoButtonsBodyText.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift index d542960d..a22a8dd5 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyText.swift @@ -28,7 +28,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? HeadersH1ButtonModel else { return } + guard let model = model as? HeadersH1NoButtonsBodyTextModel else { return } headlineBody.set(with: model.headlineBody, delegateObject, additionalData) } From 767ca5c58ad6131c80630a5c41f0c68b5ff8a29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Tue, 14 Jul 2020 21:05:35 +0530 Subject: [PATCH 05/17] updating handle action when server send response --- .../Templates/ModalMoleculeListTemplate.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index 63140e6e..bfae5168 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -7,15 +7,12 @@ // import UIKit - - open class ModalMoleculeListTemplate: MoleculeListTemplate { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- public var closeButton: Button? - //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- @@ -23,8 +20,14 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { override open func handleNewData() { super.handleNewData() - closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { _ in - MVMCoreNavigationHandler.shared()?.removeCurrentViewController() + closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in + if let self = self { + guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { + MVMCoreNavigationHandler.shared()?.removeCurrentViewController() + return + } + MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) + } }) } From 0dd1538d7c3a54d911e74377f74c43d810e3cc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Tue, 14 Jul 2020 21:07:32 +0530 Subject: [PATCH 06/17] adding back the space --- MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index bfae5168..47655762 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -7,12 +7,15 @@ // import UIKit + + open class ModalMoleculeListTemplate: MoleculeListTemplate { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- public var closeButton: Button? + //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- From da41081289b2ffe7439fa74c8e670acabce8095a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Wed, 15 Jul 2020 17:11:45 +0530 Subject: [PATCH 07/17] updating review comments --- .../Templates/ModalMoleculeListTemplate.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index 47655762..2dffb26f 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -15,7 +15,7 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { //-------------------------------------------------- public var closeButton: Button? - + //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- @@ -24,13 +24,14 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { super.handleNewData() closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { [weak self] _ in - if let self = self { - guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { - MVMCoreNavigationHandler.shared()?.removeCurrentViewController() - return - } - MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) + guard let self = self else { + return } + guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { + MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) + return + } + MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) }) } From 3827edcf6ee64627dfa39e4937356bcf171bb202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Wed, 15 Jul 2020 17:13:16 +0530 Subject: [PATCH 08/17] updating review comments --- .../Atomic/Templates/ModalMoleculeStackTemplate.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift index 937cc91d..57a58a3c 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift @@ -13,9 +13,14 @@ open class ModalMoleculeStackTemplate: MoleculeStackTemplate { override open func handleNewData() { super.handleNewData() _ = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: {[weak self] _ in - if let _ = self { - MVMCoreNavigationHandler.shared()?.removeCurrentViewController() - } + guard let self = self else { + return + } + guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { + MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) + return + } + MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) }) } From 77be31f47fa798b87ec484ec4cb53e0412c4abf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Wed, 15 Jul 2020 21:21:19 +0530 Subject: [PATCH 09/17] updating Review comments to decode from Model --- .../Templates/ListPageTemplateModel.swift | 4 ++++ .../Templates/ModalMoleculeListTemplate.swift | 4 ++-- .../Templates/ModalMoleculeStackTemplate.swift | 17 ++++++++--------- .../Templates/StackPageTemplateModel.swift | 4 ++++ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift index b2b52573..9be4113e 100644 --- a/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift @@ -18,6 +18,7 @@ import Foundation } public var molecules: [ListItemModelProtocol & MoleculeModelProtocol]? public var line: LineModel? + public var closeAction: ActionModelProtocol? //-------------------------------------------------- // MARK: - Initializer @@ -36,6 +37,7 @@ import Foundation private enum CodingKeys: String, CodingKey { case molecules case line + case closeAction } //-------------------------------------------------- @@ -46,6 +48,7 @@ import Foundation let typeContainer = try decoder.container(keyedBy: CodingKeys.self) molecules = try typeContainer.decodeModelsIfPresent(codingKey: .molecules) line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) + closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) try super.init(from: decoder) } @@ -54,6 +57,7 @@ import Foundation var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeModelsIfPresent(molecules, forKey: .molecules) try container.encode(line, forKey: .line) + try container.encodeModelIfPresent(closeAction, forKey: .closeAction) } } diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index 2dffb26f..f10abe52 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -27,11 +27,11 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { guard let self = self else { return } - guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { + guard let actionMap = self.templateModel?.closeAction else { MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) return } - MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) + MVMCoreActionHandler.shared()?.handleAction(with: actionMap.toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) }) } diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift index 57a58a3c..a4f79e7e 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift @@ -13,15 +13,14 @@ open class ModalMoleculeStackTemplate: MoleculeStackTemplate { override open func handleNewData() { super.handleNewData() _ = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: {[weak self] _ in - guard let self = self else { - return - } - guard let actionMap = self.loadObject?.pageJSON?.optionalDictionaryWithChainOfKeysOrIndexes([KeyButtonMap,"CloseButton"]) else { - MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) - return - } - MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: nil, delegateObject: self.delegateObjectIVar) + guard let self = self else { + return + } + guard let actionMap = self.templateModel?.closeAction else { + MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) + return + } + MVMCoreActionHandler.shared()?.handleAction(with: actionMap.toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) }) } - } diff --git a/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift index f21a0421..40d97814 100644 --- a/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift @@ -14,6 +14,7 @@ import Foundation return "stack" } public var moleculeStack: StackModel + public var closeAction: ActionModelProtocol? public init(pageType: String, moleculeStack: StackModel) { self.moleculeStack = moleculeStack @@ -22,11 +23,13 @@ import Foundation private enum CodingKeys: String, CodingKey { case stack + case closeAction } required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) moleculeStack = try typeContainer.decode(StackModel.self, forKey: .stack) + closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) try super.init(from: decoder) } @@ -34,5 +37,6 @@ import Foundation try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeStack, forKey: .stack) + try container.encodeModelIfPresent(closeAction, forKey: .closeAction) } } From 0ee938cf576f6a8cb246975a1f1d075a836ca39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Wed, 15 Jul 2020 23:38:49 +0530 Subject: [PATCH 10/17] adding modal class specific models --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++++ .../Templates/ListPageTemplateModel.swift | 4 -- .../ModalListPageTemplateModel.swift | 46 +++++++++++++++++++ .../Templates/ModalMoleculeListTemplate.swift | 2 +- .../ModalMoleculeStackTemplate.swift | 10 ++-- .../ModalStackPageTemplateModel.swift | 41 +++++++++++++++++ .../Templates/StackPageTemplateModel.swift | 4 -- 7 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift create mode 100644 MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 65c0e81d..74bbe551 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -105,6 +105,8 @@ 0A9D09212433796500D2E6C0 /* CarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9D091B2433796500D2E6C0 /* CarouselIndicatorModel.swift */; }; 0A9D09222433796500D2E6C0 /* CarouselIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A9D091C2433796500D2E6C0 /* CarouselIndicator.swift */; }; 0AA33B3A2398524F0067DD0F /* Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA33B392398524F0067DD0F /* Toggle.swift */; }; + 0AB000BA24BF63490090C5E7 /* ModalListPageTemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB000B924BF63490090C5E7 /* ModalListPageTemplateModel.swift */; }; + 0AB000BC24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB000BB24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift */; }; 0AB764D124460F6300E7FE72 /* UIDatePicker+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB764D024460F6300E7FE72 /* UIDatePicker+Extension.swift */; }; 0AB764D324460FA400E7FE72 /* UIPickerView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB764D224460FA400E7FE72 /* UIPickerView+Extension.swift */; }; 0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */; }; @@ -568,6 +570,8 @@ 0A9D091C2433796500D2E6C0 /* CarouselIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarouselIndicator.swift; sourceTree = ""; }; 0AA33B33239813C50067DD0F /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = ""; }; 0AA33B392398524F0067DD0F /* Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toggle.swift; sourceTree = ""; }; + 0AB000B924BF63490090C5E7 /* ModalListPageTemplateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalListPageTemplateModel.swift; sourceTree = ""; }; + 0AB000BB24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalStackPageTemplateModel.swift; sourceTree = ""; }; 0AB764D024460F6300E7FE72 /* UIDatePicker+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIDatePicker+Extension.swift"; sourceTree = ""; }; 0AB764D224460FA400E7FE72 /* UIPickerView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIPickerView+Extension.swift"; sourceTree = ""; }; 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateDropdownEntryField.swift; sourceTree = ""; }; @@ -1611,6 +1615,8 @@ D264FAA4243F66A500D98315 /* CollectionTemplateItemProtocol.swift */, D264FA8B243BCD8E00D98315 /* CollectionTemplateModel.swift */, D264FA8D243BCD9A00D98315 /* CollectionTemplate.swift */, + 0AB000B924BF63490090C5E7 /* ModalListPageTemplateModel.swift */, + 0AB000BB24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift */, ); path = Templates; sourceTree = ""; @@ -2474,6 +2480,7 @@ D23EA7FB2475F09800D60C34 /* CarouselItemProtocol.swift in Sources */, D2E2A9A323E096B1000B42E6 /* DisableableModelProtocol.swift in Sources */, D29DF11821E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.m in Sources */, + 0AB000BC24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift in Sources */, 27F973532466074500CAB5C5 /* PageBehavior.swift in Sources */, 94C2D9A323872C110006CF46 /* LabelAttributeStrikeThroughModel.swift in Sources */, D28A838523CCCA8900DFE4FC /* ScrollerModel.swift in Sources */, @@ -2502,6 +2509,7 @@ D236E5B5241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift in Sources */, D2B18B922361E65A00A9AEDC /* CoreUIObject.swift in Sources */, 014AA72E23C5059B006F3E93 /* StackCenteredPageTemplateModel.swift in Sources */, + 0AB000BA24BF63490090C5E7 /* ModalListPageTemplateModel.swift in Sources */, D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */, 011D959D2404536F000E3791 /* RuleAnyValueChangedModel.swift in Sources */, D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */, diff --git a/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift index 9be4113e..b2b52573 100644 --- a/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ListPageTemplateModel.swift @@ -18,7 +18,6 @@ import Foundation } public var molecules: [ListItemModelProtocol & MoleculeModelProtocol]? public var line: LineModel? - public var closeAction: ActionModelProtocol? //-------------------------------------------------- // MARK: - Initializer @@ -37,7 +36,6 @@ import Foundation private enum CodingKeys: String, CodingKey { case molecules case line - case closeAction } //-------------------------------------------------- @@ -48,7 +46,6 @@ import Foundation let typeContainer = try decoder.container(keyedBy: CodingKeys.self) molecules = try typeContainer.decodeModelsIfPresent(codingKey: .molecules) line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) - closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) try super.init(from: decoder) } @@ -57,7 +54,6 @@ import Foundation var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeModelsIfPresent(molecules, forKey: .molecules) try container.encode(line, forKey: .line) - try container.encodeModelIfPresent(closeAction, forKey: .closeAction) } } diff --git a/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift new file mode 100644 index 00000000..0c59514d --- /dev/null +++ b/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift @@ -0,0 +1,46 @@ +// +// ModalListPageTemplateModel.swift +// MVMCoreUI +// +// Created by Subramaniam, Ramya on 15/07/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ModalListPageTemplateModel: ListPageTemplateModel { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + open override class var identifier: String { + return "modalList" + } + + public var closeAction: ActionModelProtocol? + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + +// private enum CodingKeys: String, CodingKey { +// case closeAction +// } +// +// //-------------------------------------------------- +// // MARK: - Codec +// //-------------------------------------------------- +// +// required public init(from decoder: Decoder) throws { +// let typeContainer = try decoder.container(keyedBy: CodingKeys.self) +// closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) +// try super.init(from: decoder) +// } +// +// open override func encode(to encoder: Encoder) throws { +// try super.encode(to: encoder) +// var container = encoder.container(keyedBy: CodingKeys.self) +// try container.encodeModelIfPresent(closeAction, forKey: .closeAction) +// } +} + diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index f10abe52..f3df7a01 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -27,7 +27,7 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { guard let self = self else { return } - guard let actionMap = self.templateModel?.closeAction else { + guard let model = self.templateModel as? ModalListPageTemplateModel, let actionMap = model.closeAction else { MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) return } diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift index a4f79e7e..2a953789 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift @@ -16,11 +16,11 @@ open class ModalMoleculeStackTemplate: MoleculeStackTemplate { guard let self = self else { return } - guard let actionMap = self.templateModel?.closeAction else { - MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) - return - } - MVMCoreActionHandler.shared()?.handleAction(with: actionMap.toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) +// guard let actionMap = self.templateModel?.closeAction else { +// MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) +// return +// } +// MVMCoreActionHandler.shared()?.handleAction(with: actionMap.toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) }) } } diff --git a/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift new file mode 100644 index 00000000..ba880843 --- /dev/null +++ b/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift @@ -0,0 +1,41 @@ +// +// ModalStackPageTemplateModel.swift +// MVMCoreUI +// +// Created by Subramaniam, Ramya on 15/07/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers public class ModalStackPageTemplateModel: ThreeLayerModelBase { + public override class var identifier: String { + return "modalStack" + } + public var moleculeStack: StackModel + public var closeAction: ActionModelProtocol? + + public init(pageType: String, moleculeStack: StackModel) { + self.moleculeStack = moleculeStack + super.init(pageType: pageType) + } + + private enum CodingKeys: String, CodingKey { + case stack + case closeAction + } + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + moleculeStack = try typeContainer.decode(StackModel.self, forKey: .stack) + closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) + 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(moleculeStack, forKey: .stack) + try container.encodeModelIfPresent(closeAction, forKey: .closeAction) + } +} diff --git a/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift index 40d97814..f21a0421 100644 --- a/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift @@ -14,7 +14,6 @@ import Foundation return "stack" } public var moleculeStack: StackModel - public var closeAction: ActionModelProtocol? public init(pageType: String, moleculeStack: StackModel) { self.moleculeStack = moleculeStack @@ -23,13 +22,11 @@ import Foundation private enum CodingKeys: String, CodingKey { case stack - case closeAction } required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) moleculeStack = try typeContainer.decode(StackModel.self, forKey: .stack) - closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) try super.init(from: decoder) } @@ -37,6 +34,5 @@ import Foundation try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeStack, forKey: .stack) - try container.encodeModelIfPresent(closeAction, forKey: .closeAction) } } From 39fb2026a77b26742d9d41e12029ca4a3252eb78 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 16 Jul 2020 10:04:40 -0400 Subject: [PATCH 11/17] Revert "Merge branch 'feature/order_tracker' into 'develop'" This reverts merge request !529 --- MVMCoreUI.xcodeproj/project.pbxproj | 30 +--- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 34 ++--- .../Order Tracker/OrderTracker.swift | 133 ------------------ .../Order Tracker/OrderTrackerModel.swift | 48 ------- .../Order Tracker/Step.swift | 114 --------------- .../Order Tracker/StepModel.swift | 94 ------------- MVMCoreUI/BaseClasses/ImageView.swift | 39 ++--- .../Contents.json | 23 --- .../icon_tracker_complete.imageset/Green.png | Bin 613 -> 0 bytes .../Green@2x.png | Bin 1307 -> 0 bytes .../Green@3x.png | Bin 1984 -> 0 bytes .../Contents.json | 23 --- .../Empty state icon.png | Bin 462 -> 0 bytes .../Empty state icon@2x.png | Bin 1072 -> 0 bytes .../Empty state icon@3x.png | Bin 1636 -> 0 bytes .../Alert icon.png | Bin 548 -> 0 bytes .../Alert icon@2x.png | Bin 1203 -> 0 bytes .../Alert icon@3x.png | Bin 1900 -> 0 bytes .../Contents.json | 23 --- 19 files changed, 42 insertions(+), 519 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTracker.swift delete mode 100644 MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTrackerModel.swift delete mode 100644 MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/Step.swift delete mode 100644 MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/StepModel.swift delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Contents.json delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Green.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Green@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Green@3x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_incomplete.imageset/Contents.json delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_incomplete.imageset/Empty state icon.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_incomplete.imageset/Empty state icon@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_incomplete.imageset/Empty state icon@3x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Alert icon.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Alert icon@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Alert icon@3x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Contents.json diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index fceb829b..65c0e81d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -62,8 +62,6 @@ 01EB369323609801006832FA /* HeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368C23609801006832FA /* HeaderModel.swift */; }; 01EB369423609801006832FA /* HeadlineBodyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368D23609801006832FA /* HeadlineBodyModel.swift */; }; 01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A03123A4498200D954D8 /* CaretLinkModel.swift */; }; - 0A0B147924ACFD8300BADD56 /* OrderTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A0B147824ACFD8200BADD56 /* OrderTracker.swift */; }; - 0A0B147B24ACFDAD00BADD56 /* OrderTrackerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A0B147A24ACFDAD00BADD56 /* OrderTrackerModel.swift */; }; 0A1214A022C11A18007C7030 /* ActionDetailWithImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A12149F22C11A17007C7030 /* ActionDetailWithImage.swift */; }; 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7BAFA2232BE63400FB8E22 /* CheckboxLabel.swift */; }; 0A21DB7F235DECC500C160A2 /* EntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21DB7E235DECC500C160A2 /* EntryField.swift */; }; @@ -111,9 +109,6 @@ 0AB764D324460FA400E7FE72 /* UIPickerView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB764D224460FA400E7FE72 /* UIPickerView+Extension.swift */; }; 0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */; }; 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */; }; - 0AC16CEB24B3A1080085EF34 /* Step.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC16CEA24B3A1080085EF34 /* Step.swift */; }; - 0AC16CED24B3A11C0085EF34 /* StepModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC16CEC24B3A11C0085EF34 /* StepModel.swift */; }; - 0AC16CEE24B3A39C0085EF34 /* ImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7918F423F5E7EA00772FF4 /* ImageView.swift */; }; 0AE14F64238315D2005417F8 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE14F63238315D2005417F8 /* TextField.swift */; }; 0AE98BAF23FEF956004C5109 /* ExternalLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BAE23FEF956004C5109 /* ExternalLink.swift */; }; 0AE98BB323FF0934004C5109 /* ExternalLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB223FF0934004C5109 /* ExternalLinkModel.swift */; }; @@ -527,8 +522,6 @@ 01EB368C23609801006832FA /* HeaderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeaderModel.swift; sourceTree = ""; }; 01EB368D23609801006832FA /* HeadlineBodyModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeadlineBodyModel.swift; sourceTree = ""; }; 01F2A03123A4498200D954D8 /* CaretLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaretLinkModel.swift; sourceTree = ""; }; - 0A0B147824ACFD8200BADD56 /* OrderTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderTracker.swift; sourceTree = ""; }; - 0A0B147A24ACFDAD00BADD56 /* OrderTrackerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderTrackerModel.swift; sourceTree = ""; }; 0A12149F22C11A17007C7030 /* ActionDetailWithImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionDetailWithImage.swift; sourceTree = ""; }; 0A209CD223A7E2810068F8B0 /* UIStackViewAlignment+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackViewAlignment+Extension.swift"; sourceTree = ""; }; 0A21DB7E235DECC500C160A2 /* EntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntryField.swift; sourceTree = ""; }; @@ -579,8 +572,6 @@ 0AB764D224460FA400E7FE72 /* UIPickerView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIPickerView+Extension.swift"; sourceTree = ""; }; 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateDropdownEntryField.swift; sourceTree = ""; }; 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemDropdownEntryField.swift; sourceTree = ""; }; - 0AC16CEA24B3A1080085EF34 /* Step.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Step.swift; sourceTree = ""; }; - 0AC16CEC24B3A11C0085EF34 /* StepModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepModel.swift; sourceTree = ""; }; 0AE14F63238315D2005417F8 /* TextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = ""; }; 0AE98BAE23FEF956004C5109 /* ExternalLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExternalLink.swift; sourceTree = ""; }; 0AE98BB223FF0934004C5109 /* ExternalLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExternalLinkModel.swift; sourceTree = ""; }; @@ -1046,17 +1037,6 @@ path = Views; sourceTree = ""; }; - 0AC16CE924B3A0ED0085EF34 /* Order Tracker */ = { - isa = PBXGroup; - children = ( - 0A0B147A24ACFDAD00BADD56 /* OrderTrackerModel.swift */, - 0A0B147824ACFD8200BADD56 /* OrderTracker.swift */, - 0AC16CEC24B3A11C0085EF34 /* StepModel.swift */, - 0AC16CEA24B3A1080085EF34 /* Step.swift */, - ); - path = "Order Tracker"; - sourceTree = ""; - }; 0AE98BAD23FEF92B004C5109 /* Link */ = { isa = PBXGroup; children = ( @@ -1283,11 +1263,10 @@ C7192E7C23C301750050C2A0 /* HeadLineBodyCaretLinkImage.swift */, D2E2A99923D8D6B4000B42E6 /* HeadlineBodyButtonModel.swift */, 0A7BAD73232A8DC700FB8E22 /* HeadlineBodyButton.swift */, - EA5124FC243601600051A3A4 /* BGImageHeadlineBodyButton.swift */, EA5124FE2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift */, - 0A775F2724893937009EFB58 /* ThreeHeadlineBodyLinkModel.swift */, + EA5124FC243601600051A3A4 /* BGImageHeadlineBodyButton.swift */, 0A775F2524893916009EFB58 /* ThreeHeadlineBodyLink.swift */, - 0AC16CE924B3A0ED0085EF34 /* Order Tracker */, + 0A775F2724893937009EFB58 /* ThreeHeadlineBodyLinkModel.swift */, ); path = VerticalCombinationViews; sourceTree = ""; @@ -2148,7 +2127,6 @@ 324FB6AA249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift in Sources */, 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */, AA0A257824766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift in Sources */, - 0A0B147924ACFD8300BADD56 /* OrderTracker.swift in Sources */, 0A5D59C223AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift in Sources */, 8D070BB0241B56530099AC56 /* ListRightVariableTotalDataModel.swift in Sources */, 943784F5236B77BB006A1E82 /* Wheel.swift in Sources */, @@ -2215,7 +2193,6 @@ 9445891F2385D2E900DE9FD4 /* CaretViewModel.swift in Sources */, 01C851D323CF9E740021F976 /* LabelToggleModel.swift in Sources */, 011D95A3240453F8000E3791 /* RuleRegexModel.swift in Sources */, - 0A0B147B24ACFDAD00BADD56 /* OrderTrackerModel.swift in Sources */, D2E2A98323D8B32D000B42E6 /* EyebrowHeadlineBodyLinkModel.swift in Sources */, 012A88AD238C418100FE3DA1 /* TemplateProtocol.swift in Sources */, BB6C6AC1242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTall.swift in Sources */, @@ -2384,7 +2361,6 @@ 32F8804624765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift in Sources */, 011D958524042432000E3791 /* RulesProtocol.swift in Sources */, AA9972502475309F00FC7472 /* ListLeftVariableIconAllTextLinksModel.swift in Sources */, - 0AC16CED24B3A11C0085EF34 /* StepModel.swift in Sources */, AA69AAF62445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift in Sources */, D264FAA3243E632F00D98315 /* ProgrammaticCollectionViewController.swift in Sources */, D29DF27A21E7A533003B2FB9 /* MVMCoreUISession.m in Sources */, @@ -2403,11 +2379,9 @@ 011D95A5240455DC000E3791 /* FormGroupRule.swift in Sources */, D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */, D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */, - 0AC16CEB24B3A1080085EF34 /* Step.swift in Sources */, C7F8012123E8303200396FBD /* ListRVWheel.swift in Sources */, BB2C968F24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift in Sources */, D2FB151B23A2B65B00C20E10 /* MoleculeContainer.swift in Sources */, - 0AC16CEE24B3A39C0085EF34 /* ImageView.swift in Sources */, 279B1569242BBC2F00921D6C /* ActionModelAdapter.swift in Sources */, BB6C6AC0242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */, 8DEFA95E243DAC2F000D27E5 /* ListThreeColumnDataUsageDivider.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 09ff554f..5a3a3a1f 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -11,7 +11,7 @@ import Foundation @objcMembers public class MoleculeObjectMapping: NSObject { public var moleculeMapping: [String: MoleculeViewProtocol.Type] = [:] - + /// Returns the mapping object stored in the singleton public static func shared() -> Self? { return MVMCoreActionUtility.initializerClassCheck(CoreUIObject.sharedInstance()?.moleculeMap, classToVerify: self) as? Self @@ -22,12 +22,12 @@ import Foundation try? ModelRegistry.register(viewModelClass) moleculeMapping.updateValue(viewClass, forKey: viewModelClass.identifier) } - + /// Returns the type of molecule view for the given model public func getMoleculeClass(_ model: MoleculeModelProtocol) -> MoleculeViewProtocol.Type? { return moleculeMapping[model.moleculeName] } - + /// Creates a molecule with the given model. public func createMolecule(_ model: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> MoleculeViewProtocol? { guard let type = moleculeMapping[model.moleculeName] else { return nil } @@ -38,7 +38,7 @@ import Foundation public func getMoleculeModelForJSON(_ json: [String: Any]) throws -> MoleculeModelProtocol? { guard let moleculeName = json.optionalStringForKey(KeyMoleculeName), let type = ModelRegistry.getType(for: moleculeName, with: MoleculeModelProtocol.self) else { - throw ModelRegistry.Error.decoderErrorModelNotMapped() + throw ModelRegistry.Error.decoderErrorModelNotMapped() } guard let model = try type.decode(jsonDict: json) as? MoleculeModelProtocol else { throw ModelRegistry.Error.decoderError @@ -87,7 +87,9 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: RadioSwatches.self, viewModelClass: RadioSwatchesModel.self) MoleculeObjectMapping.shared()?.register(viewClass: Tags.self, viewModelClass: TagsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: Tag.self, viewModelClass: TagModel.self) - + + + // MARK:- Other Atoms MoleculeObjectMapping.shared()?.register(viewClass: ProgressBar.self, viewModelClass: ProgressBarModel.self) MoleculeObjectMapping.shared()?.register(viewClass: MultiProgress.self, viewModelClass: MultiProgressBarModel.self) @@ -117,9 +119,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyButton.self, viewModelClass: HeadlineBodyButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: BGImageHeadlineBodyButton.self, viewModelClass: BGImageHeadlineBodyButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ThreeHeadlineBodyLink.self, viewModelClass: ThreeHeadlineBodyLinkModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: OrderTracker.self, viewModelClass: OrderTrackerModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: Step.self, viewModelClass: StepModel.self) - + // MARK:- Left Right Molecules MoleculeObjectMapping.shared()?.register(viewClass: CornerLabels.self, viewModelClass: CornerLabelsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: LeftRightLabelView.self, viewModelClass: LeftRightLabelModel.self) @@ -127,7 +127,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyToggle.self, viewModelClass: HeadlineBodyToggleModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyLinkToggle.self, viewModelClass: HeadlineBodyLinkToggleModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ActionDetailWithImage.self, viewModelClass: ActionDetailWithImageModel.self) - + // MARK:- List items MoleculeObjectMapping.shared()?.register(viewClass: MoleculeTableViewCell.self, viewModelClass: MoleculeListItemModel.self) MoleculeObjectMapping.shared()?.register(viewClass: DropDownFilterTableViewCell.self, viewModelClass: DropDownListItemModel.self) @@ -140,8 +140,8 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: StackItem.self, viewModelClass: StackItemModel.self) MoleculeObjectMapping.shared()?.register(viewClass: MoleculeCollectionViewCell.self, viewModelClass: MoleculeCollectionItemModel.self) MoleculeObjectMapping.shared()?.register(viewClass: CarouselItem.self, viewModelClass: CarouselItemModel.self) - - + + // MARK:- Other Container Molecules MoleculeObjectMapping.shared()?.register(viewClass: MoleculeContainer.self, viewModelClass: MoleculeContainerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: MoleculeHeaderView.self, viewModelClass: MoleculeHeaderModel.self) @@ -149,7 +149,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: Scroller.self, viewModelClass: ScrollerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ModuleMolecule.self, viewModelClass: ModuleMoleculeModel.self) MoleculeObjectMapping.shared()?.register(viewClass: BGImageMolecule.self, viewModelClass: BGImageMoleculeModel.self) - + // MARK:- Other Molecules MoleculeObjectMapping.shared()?.register(viewClass: DoughnutChartView.self, viewModelClass: DoughnutChartModel.self) @@ -157,7 +157,7 @@ import Foundation try? ModelRegistry.register(NavigationItemModel.self) try? ModelRegistry.register(NavigationImageButtonModel.self) try? ModelRegistry.register(NavigationLabelButtonModel.self) - + // MARK:- Other Organisms MoleculeObjectMapping.shared()?.register(viewClass: Carousel.self, viewModelClass: CarouselModel.self) MoleculeObjectMapping.shared()?.register(viewClass: BarsIndicatorView.self, viewModelClass: BarsCarouselIndicatorModel.self) @@ -204,7 +204,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnSpeedTestDivider.self, viewModelClass: ListThreeColumnSpeedTestDividerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnBillChangesDivider.self, viewModelClass: ListThreeColumnBillChangesDividerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnDataUsageDivider.self, viewModelClass: ListThreeColumnDataUsageDividerModel.self) - + // MARK:- Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1LandingPageHeader.self, viewModelClass: HeadersH1LandingPageHeaderModel.self) @@ -218,10 +218,10 @@ import Foundation // MARK:- Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonSmall.self, viewModelClass: ListDeviceComplexButtonSmallModel.self) - + MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexLinkSmall.self, viewModelClass: ListDeviceComplexLinkSmallModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexLinkMedium.self, viewModelClass: ListDeviceComplexLinkMediumModel.self) - + // MARK:- Helper models try? ModelRegistry.register(RuleRequiredModel.self) try? ModelRegistry.register(RuleAnyRequiredModel.self) @@ -245,7 +245,7 @@ import Foundation guard let model = model else { return nil } return MoleculeObjectMapping.shared()?.getMoleculeClass(model)?.requiredModules(with: model, delegateObject, error: error) } - + /// Convenience function to add require modules for the given model to the passed in array. public static func addRequiredModules(for model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, moduleList: inout [String]?, errorList: inout [MVMCoreErrorObject]?) { guard let model = model else { return } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTracker.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTracker.swift deleted file mode 100644 index 076e77fe..00000000 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTracker.swift +++ /dev/null @@ -1,133 +0,0 @@ -// -// OrderTracker.swift -// MVMCoreUI -// -// Created by Kevin Christiano on 7/1/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import UIKit - - -open class OrderTracker: View { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - - var steps = [Step]() - - //-------------------------------------------------- - // MARK: - Life Cycle - //-------------------------------------------------- - - open override func setupView() { - super.setupView() - isOpaque = false - } - - open override func reset() { - super.reset() - - resetSteps() - } - - //-------------------------------------------------- - // MARK: - Methods - //-------------------------------------------------- - - func constrain(stepModels: [StepModel]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { - - resetSteps() - - guard let stepModels = stepModels else { return } - - var anchor = topAnchor - - for stepModel in stepModels { - - let step = Step() - step.set(with: stepModel, delegateObject, additionalData) - addSubview(step) - steps.append(step) - - step.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true - trailingAnchor.constraint(equalTo: step.trailingAnchor).isActive = true - step.topAnchor.constraint(equalTo: anchor).isActive = true - - anchor = step.bottomAnchor - } - - bottomAnchor.constraint(equalTo: anchor).isActive = true - (subviews.last as? Step)?.heightConstraint?.isActive = false - } - - func resetSteps() { - - steps.forEach { - $0.reset() - $0.removeFromSuperview() - } - - steps = [] - } - - //-------------------------------------------------- - // MARK: - Draw - //-------------------------------------------------- - - open override func draw(_ rect: CGRect) { - - guard let context = UIGraphicsGetCurrentContext(), - let firstStep = steps.first - else { return } - - context.setLineWidth(1) - let imageDimension = firstStep.stateImage.bounds.height - let halfDimension = imageDimension / 2 - let startPoint = CGPoint(x: halfDimension, y: halfDimension) - let defaultGrey: UIColor = .mvmCoolGray3 - context.move(to: startPoint) - - var lineColor = (firstStep.state?.color() ?? defaultGrey).cgColor - - for (i, step) in steps.dropFirst().enumerated() { - - if let state = step.state, state == .incomplete { - lineColor = defaultGrey.cgColor - } - - context.setStrokeColor(lineColor) - let relativeRect = convert(step.stateImage.frame, from: step.stateImage) - let point = CGPoint(x: halfDimension, y: relativeRect.midY) - - context.addLine(to: point) - context.strokePath() - - // Break out of loop since we're on the last step. - if i == steps.count - 2 { - break - } - - lineColor = (step.state?.color() ?? defaultGrey).cgColor - context.move(to: point) - } - } - - //------------------------------------------------------ - // MARK: - MoleculeViewProtocol - //------------------------------------------------------ - - public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 196 - } - - public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { - super.set(with: model, delegateObject, additionalData) - - guard let model = model as? OrderTrackerModel else { return } - - constrain(stepModels: model.steps, delegateObject: delegateObject, additionalData: additionalData) - setNeedsLayout() - setNeedsDisplay() - } -} diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTrackerModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTrackerModel.swift deleted file mode 100644 index fee4ce97..00000000 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/OrderTrackerModel.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// OrderTrackerModel.swift -// MVMCoreUI -// -// Created by Kevin Christiano on 7/1/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import UIKit - - -open class OrderTrackerModel: MoleculeModelProtocol { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - - public var backgroundColor: Color? - - public static var identifier: String = "orderTracker" - public var steps: [StepModel] - - //-------------------------------------------------- - // MARK: - Keys - //-------------------------------------------------- - - private enum CodingKeys: String, CodingKey { - case moleculeName - case backgroundColor - case steps - } - - //-------------------------------------------------- - // 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) - steps = try typeContainer.decode([StepModel].self, forKey: .steps) - } - - 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(steps, forKey: .steps) - } -} diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/Step.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/Step.swift deleted file mode 100644 index 1d53d81a..00000000 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/Step.swift +++ /dev/null @@ -1,114 +0,0 @@ -// -// Step.swift -// MVMCoreUI -// -// Created by Kevin Christiano on 7/6/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import UIKit - - -open class Step: View { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - - public var headline = Label(fontStyle: .BoldMicro) - public var bodyTop = Label(fontStyle: .RegularMicro) - public var bodyBottom = Label(fontStyle: .RegularMicro) - public var stateImage = ImageView() - - //-------------------------------------------------- - // MARK: - Constraints - //-------------------------------------------------- - - public var heightConstraint: NSLayoutConstraint? - - //-------------------------------------------------- - // MARK: - Computed Properties - //-------------------------------------------------- - - public var stepModel: StepModel? { - return model as? StepModel - } - - public var state: StepModel.State? { - return stepModel?.state - } - - //-------------------------------------------------- - // MARK: - Life Cycle - //-------------------------------------------------- - - open override func setupView() { - super.setupView() - - addSubview(stateImage) - addSubview(headline) - addSubview(bodyTop) - addSubview(bodyBottom) - - stateImage.contentMode = .scaleAspectFit - stateImage.layer.backgroundColor = UIColor.white.cgColor - stateImage.topAnchor.constraint(equalTo: topAnchor).isActive = true - stateImage.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true - stateImage.heightAnchor.constraint(equalToConstant: 18).isActive = true - stateImage.widthAnchor.constraint(equalToConstant: 18).isActive = true - - headline.topAnchor.constraint(equalTo: topAnchor, constant: 2).isActive = true - headline.leadingAnchor.constraint(equalTo: stateImage.trailingAnchor, constant: Padding.Four).isActive = true - trailingAnchor.constraint(equalTo: headline.trailingAnchor).isActive = true - - bodyTop.topAnchor.constraint(equalTo: headline.bottomAnchor).isActive = true - bodyTop.leadingAnchor.constraint(equalTo: stateImage.trailingAnchor, constant: Padding.Four).isActive = true - trailingAnchor.constraint(equalTo: bodyTop.trailingAnchor).isActive = true - - bodyBottom.topAnchor.constraint(equalTo: bodyTop.bottomAnchor).isActive = true - bodyBottom.leadingAnchor.constraint(equalTo: stateImage.trailingAnchor, constant: Padding.Four).isActive = true - trailingAnchor.constraint(equalTo: bodyBottom.trailingAnchor).isActive = true - let bodyBottomConstraint = bottomAnchor.constraint(greaterThanOrEqualTo: bodyBottom.bottomAnchor) - bodyBottomConstraint.priority = .defaultHigh - bodyBottomConstraint.isActive = true - - heightConstraint = heightAnchor.constraint(equalToConstant: 58) - heightConstraint?.priority = .defaultLow - heightConstraint?.isActive = true - } - - public override func reset() { - super.reset() - - headline.reset() - bodyTop.reset() - bodyBottom.reset() - stateImage.reset() - heightConstraint?.isActive = true - } - - //------------------------------------------------------ - // MARK: - MoleculeViewProtocol - //------------------------------------------------------ - - public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 64 - } - - public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { - super.set(with: model, delegateObject, additionalData) - - guard let model = model as? StepModel else { return } - - headline.set(with: model.headline, delegateObject, additionalData) - - if let bodyTopModel = model.bodyTop { - bodyTop.set(with: bodyTopModel, delegateObject, additionalData) - } - - if let bodyBottomModel = model.bodyBottom { - bodyBottom.set(with: bodyBottomModel, delegateObject, additionalData) - } - - stateImage.image = model.state?.image() - } -} diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/StepModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/StepModel.swift deleted file mode 100644 index f4661945..00000000 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Order Tracker/StepModel.swift +++ /dev/null @@ -1,94 +0,0 @@ -// -// StepModel.swift -// MVMCoreUI -// -// Created by Kevin Christiano on 7/6/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import UIKit - - -open class StepModel: MoleculeModelProtocol { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - - public var backgroundColor: Color? - - public static var identifier: String = "step" - public var state: State? - public var headline: LabelModel - public var bodyTop: LabelModel? - public var bodyBottom: LabelModel? - - //-------------------------------------------------- - // MARK: - Enum - //-------------------------------------------------- - - public enum State: String, Codable { - case complete - case incomplete - case invalid - - func image() -> UIImage? { - - switch self { - case .complete: - return MVMCoreUIUtility.imageNamed("icon_tracker_complete") - - case .incomplete: - return MVMCoreUIUtility.imageNamed("icon_tracker_incomplete") - - case .invalid: - return MVMCoreUIUtility.imageNamed("icon_tracker_invalid") - } - } - - func color() -> UIColor { - - switch self { - case .complete: - return .mvmGreen - - case .incomplete, .invalid: - return .mvmCoolGray3 - } - } - } - - //-------------------------------------------------- - // MARK: - Keys - //-------------------------------------------------- - - private enum CodingKeys: String, CodingKey { - case moleculeName - case backgroundColor - case state - case headline - case bodyTop - case bodyBottom - } - - //-------------------------------------------------- - // 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) - state = try typeContainer.decodeIfPresent(State.self, forKey: .state) - headline = try typeContainer.decode(LabelModel.self, forKey: .headline) - bodyTop = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .bodyTop) - bodyBottom = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .bodyBottom) - } - - 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.encodeIfPresent(bodyTop, forKey: .bodyTop) - try container.encodeIfPresent(bodyBottom, forKey: .bodyBottom) - } -} diff --git a/MVMCoreUI/BaseClasses/ImageView.swift b/MVMCoreUI/BaseClasses/ImageView.swift index 2acfc5ae..aa004d27 100644 --- a/MVMCoreUI/BaseClasses/ImageView.swift +++ b/MVMCoreUI/BaseClasses/ImageView.swift @@ -8,7 +8,7 @@ import UIKit -open class ImageView: UIImageView, MoleculeViewProtocol { +open class ImageView: UIImageView, ModelMoleculeViewProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -51,25 +51,13 @@ open class ImageView: UIImageView, MoleculeViewProtocol { } } - /// Will be called only once. - open func setupView() { - translatesAutoresizingMaskIntoConstraints = false - insetsLayoutMarginsFromSafeArea = false - MVMCoreUIUtility.setMarginsFor(self, leading: 0, top: 0, trailing: 0, bottom: 0) - } - - open func reset() { - image = nil - backgroundColor = .clear - } - //-------------------------------------------------- - // MARK: - MoleculeViewProtocol + // MARK: - ModelMoleculeViewProtocol //-------------------------------------------------- - public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { self.model = model - if let backgroundColor = model.backgroundColor { + if let backgroundColor = model?.backgroundColor { self.backgroundColor = backgroundColor.uiColor } } @@ -85,8 +73,27 @@ open class ImageView: UIImageView, MoleculeViewProtocol { open class func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer?) -> [String]? { return nil } +} + +// MARK:- MVMCoreViewProtocol +extension ImageView: MVMCoreViewProtocol { open func updateView(_ size: CGFloat) { } + /// Will be called only once. + open func setupView() { + translatesAutoresizingMaskIntoConstraints = false + insetsLayoutMarginsFromSafeArea = false + MVMCoreUIUtility.setMarginsFor(self, leading: 0, top: 0, trailing: 0, bottom: 0) + } +} + +// MARK:- MVMCoreUIMoleculeViewProtocol +extension ImageView: MVMCoreUIMoleculeViewProtocol { + + open func reset() { + backgroundColor = .clear + } + open func setAsMolecule() { } } diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Contents.json deleted file mode 100644 index 23859fda..00000000 --- a/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "Green.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "Green@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "Green@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Green.png b/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Green.png deleted file mode 100644 index 285005cbe3787d362e0d70c86d308c30c3cad3c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 613 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyy~STEL88gA~qMxhWK=?7XLoV~B;| z+9~_>SsX=<@87I9@H74p8|W%5e9WQ)+dqUjzY z??kKuHU2PqJ%96K-^{zV+J1U7($enjd7plN&-XOZebT$%S!|iteoUg@nrV8vhRDJz znnqJkuQw7kmQnltVU?f8i{-ZLPh%Kfo&5DeE~9?ZYZLo|ezUzjy}R23;@K{9N;EUxb5L)=weFmy89@P`Xpbt^EqB58R_ zi7zry|K+cp7t3y>TwfdWl66n$XTdk_9CxF)tlZNuPxD=8#LShZ@4VTzJ?CSdBs}$b z={^@Bje8e$dDLd-=38Hzw<1@5=1f)Q>g(4TQ!MM|GAK>XIH}N)?|v)J%1lPlCvoCL zleP$7tAv2PkHsGBbXQ#dGSXzx(+wx5v1{ZX-&R{J^Vqxhq7mc7to#I#ef55q<>hic jeow#e!7=%#xcxSM^#{jv{o|a^fTGyb)z4*}Q$iB}J?HRb diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Green@2x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_complete.imageset/Green@2x.png deleted file mode 100644 index 30bd32f2dd22f81f1b967a5a8d1827b28795c864..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1307 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 RJMaM%L!PdFF6*2UngFji&zb-L diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Alert icon@2x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Alert icon@2x.png deleted file mode 100644 index 65133b98f7a2a122313825e89c0258a2d8e9e48a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1203 zcmV;k1WfyhP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91B%lKT1ONa40RR91Bme*a04fgS`~Uz19Z5t%R9FekSkFrpQ5Ze<`cf-W zpHY}pd!v>?KcN^9vx4F;p^=oE&iWlb1eKX&8&YADdz4!aZAZ06@K|YwqegtTy>&DQa5g`vXgCP@Q zh`m8r^w~<>uDggacQ4_ONoa?$cC>`RG1~7AL*$b98G{+x^^@dk{t9j+^7)t1Xd8C& z$uCjF4%w1qni09jYd1{=UQ`4aT2^r zasDwv;dNAuKEh>!9CrW)!xYn*ufa9bf$_hA`g>sqYR1NKh@#FBry;`Wt>2E5rWLc^ zE`I*4ps^0r1qEEEVKWV;cwDHsbiM^pH5)gOvrcXXS7~Y)Q(b7HV&*|iXziQrO%cx!`5<% z5s$Eh$)SJFzfIy2XI#TPLGGR5Fex(CmDs=H65hp)%h4BR^)l=e2l1LC&LVVi$TXWc zz7Kd|s={JVIU`eKi*+=7vjOhwog(KhKl|n)#HlTN-n_8TV#Fg3aj8#I$E~gt0{L?mZiBo=FgVo-| z|GRl(T8my<(Eqh}3$0dvYLFHiPT~MVmZQXbNmtJKByw zN8u#8lKRO`T;f#UYjA>8#BuypH#Mj_kilX!$3;$Y`$EzQa^x)Hbmm)mR_WzJ3lfL8 z;@s*pQgdyj9X(WZoL7fc9V|qWFSc)|v3}w^o@hkK)w}u%+PsRn2=R(4N}l>;IQboS zhqBqU7C|eA%|>Datu~!V;#i#UZZJl6u~dd6`S9l=h;Q z)W-%dO6Mi>IVLVj{U!6ks#KWvK3A!zIA9L!QsB~0dIoQqO7xj(+)DdN?+4Aq$O;#Q RME?K)002ovPDHLkV1ka`FYN#T diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Alert icon@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/icon_tracker_invalid.imageset/Alert icon@3x.png deleted file mode 100644 index d8b628ef9e7afc78ac322418b3e5bb182186ddd9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1900 zcmV-y2b1`TP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91HlPCl1ONa40RR91HUIzs0P{mGqyPX0)=5M`RA>d=T2F{oRUH2A9mQ$l z>AaDMYLP*ML2UxXR-uc87NUZ=GB*(g7U?L{N*HJpqs|m16w$`qC_#z~!4^uJ8g$Vj zL(#}63lrZPm8P+o_io>J?)_cQyYJ1@d2`?VJMiB5bIDjtx4=9)xvC(~araFnk95S!^a`{%v)Zodm11Gx+I1>zD%zyr% zbTojj(Yx4Ktza`{ZKkZE--aMhhfA=l`yhVx%bTSinpk-s4Zh5-YZgBgu~Hx2;#~TKq?Sq;8&&xC z<+2C^kA8%|nsw0XvwwEuiF*MCNbn8z+mZA;!MXQt&k#O;kld!kqT}c&|A3D<4|b)3 z0$gV=Te^pFAuVfTVssDIRDcsC_>^_S`Fptd65b28^94^4!YRsKaUCgOq%*?W*&-zn z>PvkxIpRR^PcK^7EZ-=el9+~{uPILIqdnbN->#w82%MFvPxUPfRwit2idaD=Za5SZ zLvbdZQzA8t*E4PBBwN~puV^)QsB?m!ph4N#$e`3|OeQ_Ce$G&^{YY^I-kcK_4LVJ* zxM8UmFRa3xty)JcS*K!?PD9ZNY~{K%o^3c+d0`PIs_VKikladP&f=*drX2+9;5Z#5Q1&Jh`sE~;&f;{Y6!Jf|_oG~T7h zeQ=vJABSKJ?*6~SNUUiIIhfWQF`cLQuvZnhR+P2(ODoUwM9&Hw5atACZ^9+k7{}*M z!%xO1^V-mw%y!1Kl6QpJ`Y&$sXwFVd;eu`4E&|JpHc^(pVo?0k` z45!0P?8=LaIEA`+u?p_wJIzC)wVlhD!*NX54TCs^WT@LD7j&Grbgpq#FVYK@Ox}Cc zYSPCpPO^%tO&BNMB}?ZSS3~^m%i|k$_aA=QOw$?ct3_;;3FT^i)zW#!B=V;(FYLr^ zKc7cBgMF2V#TS`O=r$>jPO>t15mTeF+vC%_?8(Y&l+R!tRs0n&}l>F+R-3!p={}iPx&5FveD#*d2!iZAwf`IX?SS7W5>_>6Yf_S;Ao>MuR2nrY)7F#FUYD zp62qj(i}cqa&RKgAt||e1Yr_3VU#>!&VE_Ivf7Y*8E~GBRwhqIoYQTdcwD#`ca}!o zredA&k-#k;WY=bmQH{n_Q5EE!XM+jl8P=6=s_x}kNBPGY*wk#>3tkal5Ph7R1 zS)SwfsGM%xsnZWI`$3u#DK1AltamOUZ%_3F!IZ?*nB+c{uh#@I9+A^+wjCClQ+%7+ zGC55N4@n&+sdtoa6zYbeU#YkpyCuLYTQ?ry{A^lF^`$ Date: Thu, 16 Jul 2020 20:00:28 +0530 Subject: [PATCH 12/17] Change as per feedback and default padding added. --- .../Headers/H1/HeadersH1NoButtonsBodyTextModel.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift index fa0ab6c5..b3e5f5f7 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift @@ -18,11 +18,21 @@ public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- - public init(headlineBody: HeadlineBodyModel, buttons: TwoButtonViewModel) { + public init(headlineBody: HeadlineBodyModel) { self.headlineBody = headlineBody super.init() } + public override func setDefaults() { + if topPadding == nil { + topPadding = Padding.Component.VerticalMarginSpacing + } + if bottomPadding == nil { + bottomPadding = Padding.Component.VerticalMarginSpacing + } + super.setDefaults() + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- From 22fd63b7cad6da9d8f4fb60225b6b30a0a318db9 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 16 Jul 2020 11:40:27 -0400 Subject: [PATCH 13/17] exposing class --- MVMCoreUI.xcodeproj/project.pbxproj | 2 ++ MVMCoreUI/BaseClasses/ImageView.swift | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 65c0e81d..b17c9bec 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -109,6 +109,7 @@ 0AB764D324460FA400E7FE72 /* UIPickerView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB764D224460FA400E7FE72 /* UIPickerView+Extension.swift */; }; 0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */; }; 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */; }; + 0AD93A9F24C0AA5100E56A97 /* ImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7918F423F5E7EA00772FF4 /* ImageView.swift */; }; 0AE14F64238315D2005417F8 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE14F63238315D2005417F8 /* TextField.swift */; }; 0AE98BAF23FEF956004C5109 /* ExternalLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BAE23FEF956004C5109 /* ExternalLink.swift */; }; 0AE98BB323FF0934004C5109 /* ExternalLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE98BB223FF0934004C5109 /* ExternalLinkModel.swift */; }; @@ -2386,6 +2387,7 @@ BB6C6AC0242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */, 8DEFA95E243DAC2F000D27E5 /* ListThreeColumnDataUsageDivider.swift in Sources */, AAE7270E24AC8B9300A3ED0E /* HeadersH2CaretLink.swift in Sources */, + 0AD93A9F24C0AA5100E56A97 /* ImageView.swift in Sources */, D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */, 324FB6AC24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift in Sources */, AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */, diff --git a/MVMCoreUI/BaseClasses/ImageView.swift b/MVMCoreUI/BaseClasses/ImageView.swift index aa004d27..271ee615 100644 --- a/MVMCoreUI/BaseClasses/ImageView.swift +++ b/MVMCoreUI/BaseClasses/ImageView.swift @@ -8,7 +8,8 @@ import UIKit -open class ImageView: UIImageView, ModelMoleculeViewProtocol { + +open class ImageView: UIImageView, MoleculeViewProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -51,13 +52,19 @@ open class ImageView: UIImageView, ModelMoleculeViewProtocol { } } + public func reset() { + backgroundColor = .clear + } + + public func setAsMolecule() { } + //-------------------------------------------------- // MARK: - ModelMoleculeViewProtocol //-------------------------------------------------- public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { self.model = model - if let backgroundColor = model?.backgroundColor { + if let backgroundColor = model.backgroundColor { self.backgroundColor = backgroundColor.uiColor } } @@ -88,12 +95,3 @@ extension ImageView: MVMCoreViewProtocol { } } -// MARK:- MVMCoreUIMoleculeViewProtocol -extension ImageView: MVMCoreUIMoleculeViewProtocol { - - open func reset() { - backgroundColor = .clear - } - - open func setAsMolecule() { } -} From 66b03705742a50dd3f9a00a25b1082b86fed40e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Thu, 16 Jul 2020 21:26:10 +0530 Subject: [PATCH 14/17] updating specific model class change for Modal template --- .../ModalListPageTemplateModel.swift | 38 +++++++++---------- .../Templates/ModalMoleculeListTemplate.swift | 5 +++ .../ModalMoleculeStackTemplate.swift | 16 +++++--- .../ModalStackPageTemplateModel.swift | 11 +----- .../Templates/MoleculeStackTemplate.swift | 5 +++ 5 files changed, 41 insertions(+), 34 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift index 0c59514d..64168e88 100644 --- a/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift @@ -23,24 +23,24 @@ import Foundation // MARK: - Keys //-------------------------------------------------- -// private enum CodingKeys: String, CodingKey { -// case closeAction -// } -// -// //-------------------------------------------------- -// // MARK: - Codec -// //-------------------------------------------------- -// -// required public init(from decoder: Decoder) throws { -// let typeContainer = try decoder.container(keyedBy: CodingKeys.self) -// closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) -// try super.init(from: decoder) -// } -// -// open override func encode(to encoder: Encoder) throws { -// try super.encode(to: encoder) -// var container = encoder.container(keyedBy: CodingKeys.self) -// try container.encodeModelIfPresent(closeAction, forKey: .closeAction) -// } + private enum CodingKeys: String, CodingKey { + case closeAction + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) + try super.init(from: decoder) + } + + open override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeModelIfPresent(closeAction, forKey: .closeAction) + } } diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift index f3df7a01..ac22cd18 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeListTemplate.swift @@ -20,6 +20,11 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate { // MARK: - Lifecycle //-------------------------------------------------- + // For subclassing the model. + open override func decodeTemplate(using decoder: JSONDecoder, from data: Data) throws -> ModalListPageTemplateModel { + return try decoder.decode(ModalListPageTemplateModel.self, from: data) + } + override open func handleNewData() { super.handleNewData() diff --git a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift index 2a953789..78a1e157 100644 --- a/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/ModalMoleculeStackTemplate.swift @@ -10,17 +10,23 @@ import UIKit open class ModalMoleculeStackTemplate: MoleculeStackTemplate { + // For subclassing the model. + open override func decodeTemplate(using decoder: JSONDecoder, from data: Data) throws -> ModalStackPageTemplateModel { + return try decoder.decode(ModalStackPageTemplateModel.self, from: data) + } + override open func handleNewData() { super.handleNewData() _ = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: {[weak self] _ in guard let self = self else { return } -// guard let actionMap = self.templateModel?.closeAction else { -// MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) -// return -// } -// MVMCoreActionHandler.shared()?.handleAction(with: actionMap.toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) + + guard let model = self.templateModel as? ModalStackPageTemplateModel, let actionMap = model.closeAction else { + MVMCoreActionHandler.shared()?.handleAction(with: ActionBackModel().toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) + return + } + MVMCoreActionHandler.shared()?.handleAction(with: actionMap.toJSON(), additionalData: nil, delegateObject: self.delegateObjectIVar) }) } } diff --git a/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift index ba880843..4e878595 100644 --- a/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift @@ -8,26 +8,18 @@ import Foundation -@objcMembers public class ModalStackPageTemplateModel: ThreeLayerModelBase { +@objcMembers public class ModalStackPageTemplateModel: StackPageTemplateModel { public override class var identifier: String { return "modalStack" } - public var moleculeStack: StackModel public var closeAction: ActionModelProtocol? - public init(pageType: String, moleculeStack: StackModel) { - self.moleculeStack = moleculeStack - super.init(pageType: pageType) - } - private enum CodingKeys: String, CodingKey { - case stack case closeAction } required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - moleculeStack = try typeContainer.decode(StackModel.self, forKey: .stack) closeAction = try typeContainer.decodeModelIfPresent(codingKey: .closeAction) try super.init(from: decoder) } @@ -35,7 +27,6 @@ import Foundation public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(moleculeStack, forKey: .stack) try container.encodeModelIfPresent(closeAction, forKey: .closeAction) } } diff --git a/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift b/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift index 3d47ae3f..5154d9a6 100644 --- a/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/MoleculeStackTemplate.swift @@ -17,6 +17,11 @@ open class MoleculeStackTemplate: ThreeLayerViewController, TemplateProtocol { bottomViewOutsideOfScroll = templateModel?.anchorFooter ?? false super.handleNewData() } + + // For subclassing the model. + open func decodeTemplate(using decoder: JSONDecoder, from data: Data) throws -> StackPageTemplateModel { + return try decoder.decode(StackPageTemplateModel.self, from: data) + } open override func parsePageJSON() throws { try parseTemplate(json: loadObject?.pageJSON) From bbcbdf8f3da6bc47c5c703aec7197b06563652b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csubrra7=E2=80=9D?= <“ramya.subramaniam@verizon.com”> Date: Thu, 16 Jul 2020 21:29:55 +0530 Subject: [PATCH 15/17] updating model class positions on top of respective templates --- MVMCoreUI.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 74bbe551..8dbf2f56 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -1599,12 +1599,14 @@ D2092356244FA1EF0044AD09 /* ThreeLayerModelBase.swift */, 014AA72823C5059B006F3E93 /* StackPageTemplateModel.swift */, D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */, + 0AB000BB24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift */, 942C378D2412F5B60066E45E /* ModalMoleculeStackTemplate.swift */, 014AA72923C5059B006F3E93 /* StackCenteredPageTemplateModel.swift */, D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */, D28A837A23C928DA00DFE4FC /* MoleculeListCellProtocol.swift */, 014AA72C23C5059B006F3E93 /* ListPageTemplateModel.swift */, D2E1FAE02268E81D00AEFD8C /* MoleculeListTemplate.swift */, + 0AB000B924BF63490090C5E7 /* ModalListPageTemplateModel.swift */, 942C378B2412F4FA0066E45E /* ModalMoleculeListTemplate.swift */, 014AA72A23C5059B006F3E93 /* ThreeLayerPageTemplateModel.swift */, D2D6CD4122E78FAB00D701B8 /* ThreeLayerTemplate.swift */, @@ -1615,8 +1617,6 @@ D264FAA4243F66A500D98315 /* CollectionTemplateItemProtocol.swift */, D264FA8B243BCD8E00D98315 /* CollectionTemplateModel.swift */, D264FA8D243BCD9A00D98315 /* CollectionTemplate.swift */, - 0AB000B924BF63490090C5E7 /* ModalListPageTemplateModel.swift */, - 0AB000BB24BF64A50090C5E7 /* ModalStackPageTemplateModel.swift */, ); path = Templates; sourceTree = ""; From c62562335580cab1da84b153589cdd9ff9186741 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Thu, 16 Jul 2020 22:14:57 +0530 Subject: [PATCH 16/17] removed as per feedback. --- .../Headers/H1/HeadersH1NoButtonsBodyTextModel.swift | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift index b3e5f5f7..2921426f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift @@ -23,16 +23,6 @@ public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol super.init() } - public override func setDefaults() { - if topPadding == nil { - topPadding = Padding.Component.VerticalMarginSpacing - } - if bottomPadding == nil { - bottomPadding = Padding.Component.VerticalMarginSpacing - } - super.setDefaults() - } - //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- From eac43fb4d6be43e2d19b753fad8d9066e96322f8 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 16 Jul 2020 17:23:13 -0400 Subject: [PATCH 17/17] bug fix for listLeftvariableIconAllTextLinks --- .../List/LeftVariable/ListLeftVariableIconAllTextLinks.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 9655c4dd..f8153305 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -14,7 +14,7 @@ import Foundation // MARK: - Outlets //-------------------------------------------------- - public let leftImage = LoadImageView() + public let leftImage = LoadImageView(pinnedEdges: .all) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public var stack: Stack