From 322f5caee52dbfd161bd72d275b150485bbc66bd Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 1 Apr 2020 18:10:48 -0400 Subject: [PATCH] removing redundant code. --- MVMCoreUI.xcodeproj/project.pbxproj | 2 +- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 5 +- ...stRightVariableButtonAllTextAndLinks.swift | 6 +-- ...htVariableButtonAllTextAndLinksModel.swift | 2 +- ...stRightVariableButtonAllTextAndLinks.swift | 50 ------------------- ...htVariableButtonAllTextAndLinksModel.swift | 48 ------------------ 6 files changed, 7 insertions(+), 106 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinks.swift delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f11e633f..60829e96 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -1000,8 +1000,8 @@ AA4FC2A323F4F69600E251DB /* RightVariable */ = { isa = PBXGroup; children = ( - BB54C51E2434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift */, BB54C51F2434D92F0038326C /* ListRightVariableButtonAllTextAndLinksModel.swift */, + BB54C51E2434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift */, BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */, BB2C969124330F73006FF80C /* ListRightVariableTextLinkAllTextAndLinks.swift */, AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 3e242905..7f56f142 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -128,17 +128,18 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableIconWithRightCaret.self, viewModelClass: ListLeftVariableIconWithRightCaretModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableCheckboxAllTextAndLinks.self, viewModelClass: ListLeftVariableCheckboxAllTextAndLinksModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableRadioButtonAndPaymentMethod.self, viewModelClass: ListLeftVariableRadioButtonAndPaymentMethodModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableRadioButtonBodyText.self, viewModelClass: ListLeftVariableRadioButtonBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariablePayments.self, viewModelClass: ListRightVariablePaymentsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariableTotalData.self, viewModelClass: ListRightVariableTotalDataModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariableTextLinkAllTextAndLinks.self, viewModelClass: ListRightVariableTextLinkAllTextAndLinksModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariableButtonAllTextAndLinks.self, viewModelClass: ListRightVariableButtonAllTextAndLinksModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnFullWidthTextBodyText.self, viewModelClass: ListOneColumnFullWidthTextBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageListItem.self, viewModelClass: ListFourColumnDataUsageListItemModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableRadioButtonBodyText.self, viewModelClass: ListLeftVariableRadioButtonBodyTextModel.self) // Designed Section Dividers MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) @@ -146,8 +147,6 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerShort.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerShortModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnTextWithWhitespaceDividerTall.self, viewModelClass: ListOneColumnTextWithWhitespaceDividerTallModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnFullWidthTextDividerSubsection.self, viewModelClass: ListOneColumnFullWidthTextDividerSubsectionModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariableButtonAllTextAndLinks.self, viewModelClass: ListRightVariableButtonAllTextAndLinksModel.self) - // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift index c5f66b9a..25885044 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift @@ -18,8 +18,8 @@ import Foundation // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(spacing: 0, horizontalAlignment: .leading)), - (view: button, model: StackItemModel( horizontalAlignment:.fill, verticalAlignment: .center))], + stack = Stack.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading)), + (view: button, model: StackItemModel(horizontalAlignment:.fill))], axis: .horizontal) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -37,7 +37,7 @@ import Foundation stack.restack() } - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.set(with: model, delegateObject, additionalData) guard let model = model as? ListRightVariableButtonAllTextAndLinksModel else { return } button.set(with: model.button, delegateObject, additionalData) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift index 466456b4..41d4ec72 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift @@ -7,7 +7,7 @@ // import Foundation -public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel,MoleculeModelProtocol{ +public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { public static var identifier: String = "listRVBtn" public var button: ButtonModel public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinks.swift deleted file mode 100644 index 0fd7fdad..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinks.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// ListRightVariableButtonAllTextAndLinks.swift -// MVMCoreUI -// -// Created by Dhamodaram Nandi on 17/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation -@objcMembers open class ListRightVariableButtonAllTextAndLinks: TableViewCell { - - //----------------------------------------------------- - // MARK: - Outlets - //----------------------------------------------------- - public var stack: Stack - public let button = PrimaryButton.button() - public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero) - - // MARK: - Initializers - public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(spacing: 0, horizontalAlignment: .leading)), - (view: button, model: StackItemModel( horizontalAlignment:.fill, verticalAlignment: .center))], - axis: .horizontal) - super.init(style: style, reuseIdentifier: reuseIdentifier) - } - - public required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - //----------------------------------------------------- - // MARK: - View Lifecycle - //----------------------------------------------------- - override open func setupView() { - super.setupView() - addMolecule(stack) - stack.restack() - } - - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?){ - super.set(with: model, delegateObject, additionalData) - guard let model = model as? ListRightVariableButtonAllTextAndLinksModel else { return } - button.set(with: model.button, delegateObject, additionalData) - eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) - } - - open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 90 - } -} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift deleted file mode 100644 index a306a86c..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/RightVariable/ListRightVariableButtonAllTextAndLinksModel.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// ListRightVariableButtonAllTextAndLinksModel.swift -// MVMCoreUI -// -// Created by Dhamodaram Nandi on 17/03/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation -public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel,MoleculeModelProtocol{ - public static var identifier: String = "listRVBtn" - public var button: ButtonModel - public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel - - public init(button: ButtonModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) { - self.button = button - self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink - super.init() - } - - /// Defaults to set - override public func setDefaults() { - super.setDefaults() - self.button.size = .tiny - self.button.style = ButtonStyle.secondary - } - - private enum CodingKeys: String, CodingKey { - case moleculeName - case button - case eyebrowHeadlineBodyLink - } - - required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - button = try typeContainer.decode(ButtonModel.self, forKey: .button) - eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink) - 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(button, forKey: .button) - try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink) - } -}