From f378e66731556bf317a020d2ce722e4a437808d2 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 24 Mar 2020 19:53:03 -0400 Subject: [PATCH] update --- MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift | 13 +++++++++++++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 6 +++--- .../VerticalCombinationViews/HeadlineBody.swift | 2 +- MVMCoreUI/Atomic/Organisms/Carousel.swift | 4 ++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift index 6c9242f9..74e6efa4 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift @@ -12,6 +12,19 @@ import Foundation @objcMembers public class LabelModel: MoleculeModelProtocol { public enum FontStyle: String, Codable { + case Title2XLarge + case TitleXLarge + case BoldTitleLarge + case RegularTitleLarge + case BoldTitleMedium + case RegularTitleMedium + case BoldBodyLarge + case RegularBodyLarge + case BoldBodySmall + case RegularBodySmall + case BoldMicro + case RegularMicro + // Legacy case H1 case H2 case H3 diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index e6806e0c..bfa6db01 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -18,18 +18,18 @@ import Foundation } /// Registers the model with the model registry and the view with the mapper. - func register(viewClass: V.Type, viewModelClass: M.Type) { + public func register(viewClass: V.Type, viewModelClass: M.Type) { try? ModelRegistry.register(viewModelClass) moleculeMapping.updateValue(viewClass, forKey: viewModelClass.identifier) } /// Returns the type of molecule view for the given model - func getMoleculeClass(_ model: MoleculeModelProtocol) -> MoleculeViewProtocol.Type? { + public func getMoleculeClass(_ model: MoleculeModelProtocol) -> MoleculeViewProtocol.Type? { return moleculeMapping[model.moleculeName] } /// Creates a molecule with the given model. - func createMolecule(_ model: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> MoleculeViewProtocol? { + public func createMolecule(_ model: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> MoleculeViewProtocol? { guard let type = moleculeMapping[model.moleculeName] else { return nil } return type.init(model: model, delegateObject, additionalData) } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift index 810c26fb..c5a7f8c6 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift @@ -11,7 +11,7 @@ import UIKit open class HeadlineBody: View { let headlineLabel = Label.commonLabelH2(true) let messageLabel = Label.commonLabelB2(true) - var spaceBetweenLabelsConstant = PaddingTwo + var spaceBetweenLabelsConstant = PaddingOne var spaceBetweenLabels: NSLayoutConstraint? var leftConstraintTitle: NSLayoutConstraint? var rightConstraintTitle: NSLayoutConstraint? diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 8409cd24..a7117e33 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -28,11 +28,11 @@ open class Carousel: View { /// The number of pages that there are. Used for the page control and for calculations. Should not include the looping dummy cells. Be sure to set this if subclassing and not using the molecules. open var numberOfPages = 0 - /// The json for the molecules. + /// The models for the molecules. var molecules: [MoleculeModelProtocol]? /// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%. - var itemAlignment = UICollectionView.ScrollPosition.left + public var itemAlignment = UICollectionView.ScrollPosition.left /// From 0-1. The item width as a percent of the carousel width. public var itemWidthPercent: Float = 1