From 2e99d980e8721ff45329d00622d49264ea474d44 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 28 Feb 2020 14:08:38 -0500 Subject: [PATCH] open for mobile first --- .../Containers/Views/Container/ContainerModel.swift | 4 ++-- ...istLeftVariableCheckboxAllTextAndLinksModel.swift | 4 ++-- MVMCoreUI/Molecules/Items/ListItemModel.swift | 6 +++--- .../EyebrowHeadlineBodyLink.swift | 12 ++++++------ MVMCoreUI/Organisms/MoleculeStackView.swift | 2 +- MVMCoreUI/Organisms/Stack.swift | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/MVMCoreUI/Containers/Views/Container/ContainerModel.swift b/MVMCoreUI/Containers/Views/Container/ContainerModel.swift index a5e89adb..a18e8589 100644 --- a/MVMCoreUI/Containers/Views/Container/ContainerModel.swift +++ b/MVMCoreUI/Containers/Views/Container/ContainerModel.swift @@ -8,7 +8,7 @@ import Foundation -public class ContainerModel: ContainerModelProtocol, Codable { +open class ContainerModel: ContainerModelProtocol, Codable { public var horizontalAlignment: UIStackView.Alignment? public var verticalAlignment: UIStackView.Alignment? public var useHorizontalMargins: Bool? @@ -48,7 +48,7 @@ public class ContainerModel: ContainerModelProtocol, Codable { bottomMarginPadding = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .bottomMarginPadding) } - public func encode(to encoder: Encoder) throws { + open func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(ContainerHelper.getAlignmentString(for: verticalAlignment), forKey: .verticalAlignment) try container.encodeIfPresent(ContainerHelper.getAlignmentString(for: horizontalAlignment), forKey: .horizontalAlignment) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift index 4217b72a..188af025 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinksModel.swift @@ -8,8 +8,8 @@ import Foundation -public class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { - public class var identifier: String { +open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { + open class var identifier: String { return "listLVCB" } public var checkbox: CheckboxModel diff --git a/MVMCoreUI/Molecules/Items/ListItemModel.swift b/MVMCoreUI/Molecules/Items/ListItemModel.swift index 973a487a..4e0ccd35 100644 --- a/MVMCoreUI/Molecules/Items/ListItemModel.swift +++ b/MVMCoreUI/Molecules/Items/ListItemModel.swift @@ -9,7 +9,7 @@ import Foundation -@objcMembers public class ListItemModel: ContainerModel, ListItemModelProtocol { +@objcMembers open class ListItemModel: ContainerModel, ListItemModelProtocol { public var backgroundColor: Color? public var action: ActionModelProtocol? public var hideArrow: Bool? @@ -25,7 +25,7 @@ import Foundation } /// Defaults to set - public func setDefaults() { + open func setDefaults() { if useHorizontalMargins == nil { useHorizontalMargins = true } @@ -53,7 +53,7 @@ import Foundation setDefaults() } - public override func encode(to encoder: Encoder) throws { + open override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) diff --git a/MVMCoreUI/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index 58fa2d00..49b08b44 100644 --- a/MVMCoreUI/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -13,11 +13,11 @@ import UIKit // MARK: - Outlets //-------------------------------------------------- - let stack = Stack(frame: .zero) - let eyebrow = Label.commonLabelB3(true) - let headline = Label.commonLabelB1(true) - let body = Label.commonLabelB2(true) - let link = Link() + public let stack = Stack(frame: .zero) + public let eyebrow = Label.commonLabelB3(true) + public let headline = Label.commonLabelB1(true) + public let body = Label.commonLabelB2(true) + public let link = Link() var casteModel: EyebrowHeadlineBodyLinkModel? { get { return model as? EyebrowHeadlineBodyLinkModel } @@ -72,7 +72,7 @@ import UIKit stack.restack() } - public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return 65 } } diff --git a/MVMCoreUI/Organisms/MoleculeStackView.swift b/MVMCoreUI/Organisms/MoleculeStackView.swift index 653e2ebf..12d79dcd 100644 --- a/MVMCoreUI/Organisms/MoleculeStackView.swift +++ b/MVMCoreUI/Organisms/MoleculeStackView.swift @@ -9,7 +9,7 @@ import UIKit open class MoleculeStackView: Stack { - override var stackModel: MoleculeStackModel? { + open override var stackModel: MoleculeStackModel? { get { return model as? MoleculeStackModel } } diff --git a/MVMCoreUI/Organisms/Stack.swift b/MVMCoreUI/Organisms/Stack.swift index b0841e7c..696964f1 100644 --- a/MVMCoreUI/Organisms/Stack.swift +++ b/MVMCoreUI/Organisms/Stack.swift @@ -14,11 +14,11 @@ open class Stack: Container where T: (StackModelProtocol & MoleculeModelProto // MARK: - Properties //-------------------------------------------------- - var contentView: UIView = MVMCoreUICommonViewsUtility.commonView() - var stackModel: T? { + open var contentView: UIView = MVMCoreUICommonViewsUtility.commonView() + open var stackModel: T? { get { return model as? T } } - var stackItems: [UIView] = [] + open var stackItems: [UIView] = [] //-------------------------------------------------- // MARK: - Helpers