From 93ed792856c57be13d03e61459550f0991cd5b36 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 5 Jun 2020 09:06:41 -0400 Subject: [PATCH 1/9] revised factory functions and methods --- .../Atomic/Atoms/Selectors/RadioBox.swift | 4 +- .../Atomic/Atoms/Selectors/RadioSwatch.swift | 2 +- .../NumericIndicatorView.swift | 2 +- .../Atomic/Atoms/Views/CheckboxLabel.swift | 2 +- .../Atomic/Atoms/Views/Label/Label.swift | 100 +++--------------- .../Atoms/Views/LeftRightLabelView.swift | 4 +- .../ListDeviceComplexButtonMedium.swift | 16 +-- .../Device/ListDeviceComplexButtonSmall.swift | 16 +-- .../Device/ListDeviceComplexLinkMedium.swift | 16 +-- .../Device/ListDeviceComplexLinkSmall.swift | 16 +-- .../ListFourColumnDataUsageListItem.swift | 16 +-- .../ListLeftVariableIconWithRightCaret.swift | 8 +- ...ftVariableIconWithRightCaretBodyText.swift | 4 +- ...tVariableNumberedListAllTextAndLinks.swift | 4 +- ...tVariableRadioButtonAndPaymentMethod.swift | 4 +- ...neColumnFullWidthTextAllTextAndLinks.swift | 16 +-- .../List/RightVariable/ListRVWheel.swift | 8 +- .../ListRightVariablePayments.swift | 4 +- ...htVariablePriceChangeAllTextAndLinks.swift | 2 +- ...ListRightVariablePriceChangeBodyText.swift | 2 +- .../ListRightVariableTotalData.swift | 8 +- .../ListThreeColumnDataUsage.swift | 12 +-- .../ListThreeColumnInternationalData.swift | 12 +-- .../ListTwoColumnCompareChanges.swift | 32 +++--- .../ListTwoColumnPriceDescription.swift | 16 +-- .../TwoColumn/ListTwoColumnPriceDetails.swift | 8 +- .../LockUps/ListProgressBarData.swift | 8 +- .../ListFourColumnDataUsageDivider.swift | 16 +-- ...ColumnFullWidthTextDividerSubsection.swift | 8 +- ...ColumnTextWithWhitespaceDividerShort.swift | 8 +- ...eColumnTextWithWhitespaceDividerTall.swift | 6 +- .../ListThreeColumnBillChangesDivider.swift | 12 +-- .../ListThreeColumnDataUsageDivider.swift | 12 +-- ...tThreeColumnInternationalDataDivider.swift | 12 +-- .../ListThreeColumnSpeedTestDivider.swift | 12 +-- .../ListTwoColumnSubsectionDivider.swift | 8 +- .../Doughnut/ColorViewWithLabel.swift | 2 +- .../Molecules/Doughnut/DoughnutChart.swift | 4 +- .../ImageHeadlineBody.swift | 4 +- .../LeftRightViews/CornerLabels.swift | 16 +-- .../ToggleMolecules/LabelToggle.swift | 4 +- .../EyebrowHeadlineBodyLink.swift | 12 +-- .../HeadlineBody.swift | 20 ++-- .../StringAndMoleculeView.swift | 2 +- 44 files changed, 216 insertions(+), 284 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift index 785d6ae6..1118ca33 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift @@ -9,8 +9,8 @@ import Foundation open class RadioBox: Control { - public let label = Label.createLabelRegularBodySmall(true) - public let subTextLabel = Label.createLabelRegularMicro(true) + public let label = Label(fontStyle: .RegularBodySmall) + public let subTextLabel = Label(fontStyle: .RegularMicro) public var isOutOfStock = false public var accentColor = UIColor.mvmRed diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatch.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatch.swift index d7413e07..d3ac7d0b 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatch.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatch.swift @@ -13,7 +13,7 @@ open class RadioSwatch: Control { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public let bottomText = Label.createLabelRegularMicro(true) + public let bottomText = Label(fontStyle: .RegularMicro) private var circleLayer: CAShapeLayer? private var selectedLayer: CALayer? diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift index 04ea2fcd..afbe30d4 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift @@ -16,7 +16,7 @@ open class NumericIndicatorView: CarouselIndicator { /// Text to display the current count of total pages for viewing. open var pageCount: Label = { - let label = Label.createLabelRegularBodySmall(true) + let label = Label(fontStyle: .RegularBodySmall) label.isAccessibilityElement = false label.setContentCompressionResistancePriority(.required, for: .vertical) label.textAlignment = .center diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift index 9d203ea9..281c306d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift @@ -13,7 +13,7 @@ //-------------------------------------------------- public let checkbox = Checkbox() - public let label = Label.createLabelRegularBodySmall(true) + public let label = Label(fontStyle: .RegularBodySmall) //-------------------------------------------------- // MARK: - Properties diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index d47a374f..14250f30 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -13,7 +13,6 @@ public typealias ActionBlock = () -> () @objcMembers open class Label: UILabel, MVMCoreViewProtocol, MoleculeViewProtocol, MVMCoreUIViewConstrainingProtocol, MFButtonProtocol { - //------------------------------------------------------ // MARK: - Properties //------------------------------------------------------ @@ -97,7 +96,7 @@ public typealias ActionBlock = () -> () accessibilityCustomActions = [] accessibilityTraits = .staticText - let tapGesture = UITapGestureRecognizer(target: self, action: #selector(textLinkTapped(_:))) + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(textLinkTapped)) tapGesture.numberOfTapsRequired = 1 addGestureRecognizer(tapGesture) } @@ -117,6 +116,15 @@ public typealias ActionBlock = () -> () setupView() } + public init(fontStyle: Styler.Font, _ scale: Bool = true) { + super.init(frame: .zero) + setupView() + + font = fontStyle.getFont(false) + textColor = .mvmBlack + setScale(scale) + } + @objc convenience public init(standardFontSize size: CGFloat) { self.init() standardFontSize = size @@ -142,88 +150,6 @@ public typealias ActionBlock = () -> () // MARK: - Factory Functions //------------------------------------------------------ - /// Title 2XLarge - @objc public static func createLabelTitle2XLarge(_ scale: Bool) -> Label { - let label = Label.label() - label.styleTitle2XLarge(scale) - return label - } - - /// TitleXLarge - @objc public static func createLabelTitleXLarge(_ scale: Bool) -> Label { - let label = Label.label() - label.styleTitleXLarge(scale) - return label - } - - /// BoldTitleLarge - @objc public static func createLabelBoldTitleLarge(_ scale: Bool) -> Label { - let label = Label.label() - label.styleBoldTitleLarge(scale) - return label - } - - /// RegularTitleLarge - @objc public static func createLabelRegularTitleLarge(_ scale: Bool) -> Label { - let label = Label.label() - label.styleRegularTitleLarge(scale) - return label - } - - /// BoldTitleMedium - @objc public static func createLabelBoldTitleMedium(_ scale: Bool) -> Label { - let label = Label.label() - label.styleBoldTitleMedium(scale) - return label - } - - /// RegularTitleMedium - @objc public static func createLabelRegularTitleMedium(_ scale: Bool) -> Label { - let label = Label.label() - label.styleRegularTitleMedium(scale) - return label - } - - /// BoldBodyLarge - @objc public static func createLabelBoldBodyLarge(_ scale: Bool) -> Label { - let label = Label.label() - label.styleBoldBodyLarge(scale) - return label - } - - /// RegularBodyLarge - @objc public static func createLabelRegularBodyLarge(_ scale: Bool) -> Label { - let label = Label.label() - label.styleRegularBodyLarge(scale) - return label - } - - /// BoldBodySmall - @objc public static func createLabelBoldBodySmall(_ scale: Bool) -> Label { - let label = Label.label() - label.styleBoldBodySmall(scale) - return label - } - - /// RegularBodySmall - @objc public static func createLabelRegularBodySmall(_ scale: Bool) -> Label { - let label = Label.label() - label.styleRegularBodySmall(scale) - return label - } - /// BoldMicro - @objc public static func createLabelBoldMicro(_ scale: Bool) -> Label { - let label = Label.label() - label.styleBoldMicro(scale) - return label - } - /// RegularMicro - @objc public static func createLabelRegularMicro(_ scale: Bool) -> Label { - let label = Label.label() - label.styleRegularMicro(scale) - return label - } - //2.0 fonts init methods /// H1 -> HeadlineLarge @objc public static func commonLabelH1(_ scale: Bool) -> Label { @@ -572,6 +498,12 @@ public typealias ActionBlock = () -> () // MARK: - Methods //------------------------------------------------------ + public func setFontStyle(_ fontStyle: Styler.Font, _ scale: Bool = true) { + font = fontStyle.getFont(false) + textColor = .mvmBlack + setScale(scale) + } + //mva 3.0 font @objc public func styleTitle2XLarge(_ scale: Bool) { MFStyler.styleLabelTitle2XLarge(self, genericScaling: false) diff --git a/MVMCoreUI/Atomic/Atoms/Views/LeftRightLabelView.swift b/MVMCoreUI/Atomic/Atoms/Views/LeftRightLabelView.swift index a7d85f86..3981152a 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LeftRightLabelView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LeftRightLabelView.swift @@ -14,8 +14,8 @@ import Foundation // MARK: - Outlets //------------------------------------------------------ - let leftTextLabel = Label.createLabelBoldBodySmall(true) - let rightTextLabel = Label.createLabelBoldBodySmall(true) + let leftTextLabel = Label(fontStyle: .BoldBodySmall) + let rightTextLabel = Label(fontStyle: .BoldBodySmall) //------------------------------------------------------ // MARK: - Constraints diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index e6e226cb..a96e1047 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -10,10 +10,10 @@ import Foundation @objcMembers open class ListDeviceComplexButtonMedium: TableViewCell { public var verticalStack: Stack - public let eyebrow = Label.createLabelRegularMicro(true) - public let headline = Label.createLabelBoldTitleMedium(true) - public let body = Label.createLabelRegularBodySmall(true) - public let body2 = Label.createLabelRegularBodySmall(true) + public let eyebrow = Label(fontStyle: .RegularMicro) + public let headline = Label(fontStyle: .BoldTitleMedium) + public let body = Label(fontStyle: .RegularBodySmall) + public let body2 = Label(fontStyle: .RegularBodySmall) public let button = PillButton(frame: .zero) public let rightImageView = LoadImageView() public var stack: Stack @@ -67,10 +67,10 @@ import Foundation } public func setDefault() { - eyebrow.styleRegularMicro(true) - headline.styleBoldTitleMedium(true) - body.styleRegularBodySmall(true) - body2.styleRegularBodySmall(true) + eyebrow.setFontStyle(.RegularMicro) + headline.setFontStyle(.BoldTitleMedium) + body.setFontStyle(.RegularBodySmall) + body2.setFontStyle(.RegularBodySmall) eyebrow.textColor = .mvmCoolGray6 } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index e8436620..3f276a2c 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -10,10 +10,10 @@ import Foundation @objcMembers open class ListDeviceComplexButtonSmall: TableViewCell { public var verticalStack: Stack - public let eyebrow = Label.createLabelRegularMicro(true) - public let headline = Label.createLabelBoldTitleMedium(true) - public let body = Label.createLabelRegularBodySmall(true) - public let body2 = Label.createLabelRegularBodySmall(true) + public let eyebrow = Label(fontStyle: .RegularMicro) + public let headline = Label(fontStyle: .BoldTitleMedium) + public let body = Label(fontStyle: .RegularBodySmall) + public let body2 = Label(fontStyle: .RegularBodySmall) public let button = PillButton(frame: .zero) public let rightImageView = LoadImageView() public var stack: Stack @@ -67,10 +67,10 @@ import Foundation } public func setDefault() { - eyebrow.styleRegularMicro(true) - headline.styleBoldTitleMedium(true) - body.styleRegularBodySmall(true) - body2.styleRegularBodySmall(true) + eyebrow.setFontStyle(.RegularMicro) + headline.setFontStyle(.BoldTitleMedium) + body.setFontStyle(.RegularBodySmall) + body2.setFontStyle(.RegularBodySmall) eyebrow.textColor = .mvmCoolGray6 } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift index 573335c0..d3262203 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift @@ -12,10 +12,10 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - public let eyebrow = Label.createLabelRegularMicro(true) - public let headline = Label.createLabelBoldTitleMedium(true) - public let body = Label.createLabelRegularBodySmall(true) - public let body2 = Label.createLabelRegularBodySmall(true) + public let eyebrow = Label(fontStyle: .RegularMicro) + public let headline = Label(fontStyle: .BoldTitleMedium) + public let body = Label(fontStyle: .RegularBodySmall) + public let body2 = Label(fontStyle: .RegularBodySmall) public let twoLinkView = TwoLinkView() public let rightImage = LoadImageView() let verticalStack: Stack @@ -68,10 +68,10 @@ import Foundation open override func reset() { super.reset() - eyebrow.styleRegularMicro(true) - headline.styleBoldTitleMedium(true) - body.styleRegularBodySmall(true) - body2.styleRegularBodySmall(true) + eyebrow.setFontStyle(.RegularMicro) + headline.setFontStyle(.BoldTitleMedium) + body.setFontStyle(.RegularBodySmall) + body2.setFontStyle(.RegularBodySmall) eyebrow.textColor = .mvmCoolGray6 } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift index 49173067..2637fde8 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift @@ -12,10 +12,10 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - public let eyebrow = Label.createLabelRegularMicro(true) - public let headline = Label.createLabelBoldTitleMedium(true) - public let body = Label.createLabelRegularBodySmall(true) - public let body2 = Label.createLabelRegularBodySmall(true) + public let eyebrow = Label(fontStyle: .RegularMicro) + public let headline = Label(fontStyle: .BoldTitleMedium) + public let body = Label(fontStyle: .RegularBodySmall) + public let body2 = Label(fontStyle: .RegularBodySmall) public let twoLinkView = TwoLinkView() public let rightImage = LoadImageView() let verticalStack: Stack @@ -68,10 +68,10 @@ import Foundation open override func reset() { super.reset() - eyebrow.styleRegularMicro(true) - headline.styleBoldTitleMedium(true) - body.styleRegularBodySmall(true) - body2.styleRegularBodySmall(true) + eyebrow.setFontStyle(.RegularMicro) + headline.setFontStyle(.BoldTitleMedium) + body.setFontStyle(.RegularBodySmall) + body2.setFontStyle(.RegularBodySmall) eyebrow.textColor = .mvmCoolGray6 } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift index a42b6797..4bf844e2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift @@ -14,10 +14,10 @@ import Foundation // MARK: - Outlets //----------------------------------------------------- var stack: Stack - let label1 = Label.createLabelRegularBodySmall(true) - let label2 = Label.createLabelRegularBodySmall(true) - let label3 = Label.createLabelRegularBodySmall(true) - let label4 = Label.createLabelRegularBodySmall(true) + let label1 = Label(fontStyle: .RegularBodySmall) + let label2 = Label(fontStyle: .RegularBodySmall) + let label3 = Label(fontStyle: .RegularBodySmall) + let label4 = Label(fontStyle: .RegularBodySmall) let arrow = Arrow(frame: .zero) let arrowAndLabel2Stack: Stack @@ -69,9 +69,9 @@ import Foundation open override func reset() { super.reset() - label1.styleRegularBodySmall(true) - label2.styleRegularBodySmall(true) - label3.styleRegularBodySmall(true) - label4.styleRegularBodySmall(true) + label1.setFontStyle(.RegularBodySmall) + label2.setFontStyle(.RegularBodySmall) + label3.setFontStyle(.RegularBodySmall) + label4.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift index db7decbd..4ab804b9 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift @@ -14,8 +14,8 @@ import UIKit // MARK: - Outlets //------------------------------------------------------- let leftImage = LoadImageView(pinnedEdges: .all) - let leftLabel = Label.createLabelRegularBodySmall(true) - let rightLabel = Label.createLabelRegularBodySmall(true) + let leftLabel = Label(fontStyle: .RegularBodySmall) + let rightLabel = Label(fontStyle: .RegularBodySmall) var stack: Stack //----------------------------------------------------- @@ -63,7 +63,7 @@ import UIKit open override func reset() { super.reset() - leftLabel.styleRegularBodySmall(true) - rightLabel.styleRegularBodySmall(true) + leftLabel.setFontStyle(.RegularBodySmall) + rightLabel.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift index e508c8f4..eee1b7d4 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift @@ -13,7 +13,7 @@ import Foundation //------------------------------------------------------- public let leftImage = LoadImageView() public let headlineBody = HeadlineBody() - public let rightLabel = Label.createLabelRegularBodySmall(true) + public let rightLabel = Label(fontStyle: .RegularBodySmall) public let rightLabelStackItem: StackItem public var stack: Stack @@ -73,6 +73,6 @@ import Foundation open override func reset() { super.reset() - rightLabel.styleRegularBodySmall(true) + rightLabel.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index d623311b..54e7bc52 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -12,7 +12,7 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - public let leftLabel = Label.createLabelTitle2XLarge(true) + public let leftLabel = Label(fontStyle: .Title2XLarge) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero) public var stack: Stack @@ -56,7 +56,7 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleTitle2XLarge(true) + leftLabel.setFontStyle(.Title2XLarge) } open override func layoutSubviews() { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 7ee0b619..63056d61 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -47,7 +47,7 @@ import UIKit addMolecule(stack) stack.restack() eyebrowHeadlineBodyLink.body.textColor = .mvmOrangeAA - eyebrowHeadlineBodyLink.headline.styleBoldBodySmall(true) + eyebrowHeadlineBodyLink.headline.setFontStyle(.BoldBodySmall) accessibilityTraits = radioButton.accessibilityTraits accessibilityHint = radioButton.accessibilityHint @@ -61,7 +61,7 @@ import UIKit open override func reset() { super.reset() eyebrowHeadlineBodyLink.body.textColor = .mvmOrangeAA - eyebrowHeadlineBodyLink.headline.styleBoldBodySmall(true) + eyebrowHeadlineBodyLink.headline.setFontStyle(.BoldBodySmall) } //---------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index 2291c080..f17c9535 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -15,10 +15,10 @@ import Foundation //----------------------------------------------------- var stack: Stack - let eyebrow = Label.createLabelRegularMicro(true) - let headline = Label.createLabelBoldTitleMedium(true) - let subHeadline = Label.createLabelBoldBodySmall(true) - let body = Label.createLabelRegularBodySmall(true) + let eyebrow = Label(fontStyle: .RegularMicro) + let headline = Label(fontStyle: .BoldTitleMedium) + let subHeadline = Label(fontStyle: .BoldBodySmall) + let body = Label(fontStyle: .RegularBodySmall) let link = Link() //----------------------------------------------------- @@ -62,9 +62,9 @@ import Foundation open override func reset() { super.reset() - eyebrow.styleRegularMicro(true) - headline.styleBoldTitleMedium(true) - subHeadline.styleBoldBodySmall(true) - body.styleRegularBodySmall(true) + eyebrow.setFontStyle(.RegularMicro) + headline.setFontStyle(.BoldTitleMedium) + subHeadline.setFontStyle(.BoldBodySmall) + body.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift index 40579a09..33822f80 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift @@ -9,8 +9,8 @@ import Foundation @objcMembers open class ListRVWheel: TableViewCell { let wheel = Wheel(frame: .zero) - let leftLabel = Label.createLabelBoldBodySmall(true) - let rightLabel = Label.createLabelRegularBodySmall(true) + let leftLabel = Label(fontStyle: .BoldBodySmall) + let rightLabel = Label(fontStyle: .RegularBodySmall) var stack: Stack //----------------------------------------------------- @@ -54,8 +54,8 @@ import Foundation //------------------------------------------------- open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - rightLabel.styleRegularBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.RegularBodySmall) } public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift index ce73c082..767ac01f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift @@ -13,7 +13,7 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //------------------------------------------------------- - let leftLabel = Label.createLabelBoldBodySmall(true) + let leftLabel = Label(fontStyle: .BoldBodySmall) let rightImage = LoadImageView(pinnedEdges: .all) var stack: Stack @@ -57,6 +57,6 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index ab135eb6..aef75633 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -15,7 +15,7 @@ import Foundation //----------------------------------------------------- public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero) public let arrow = Arrow(frame: .zero) - public let rightLabel = Label.createLabelRegularBodySmall(true) + public let rightLabel = Label(fontStyle: .Title2XLarge) private let stack: Stack private let arrowStackItem: StackItem private let rightLabelStackItem: StackItem diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift index 63e90d34..66302b5f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift @@ -15,7 +15,7 @@ import Foundation private let stack: Stack public let headlineBody = HeadlineBody(frame: .zero) public let arrow = Arrow(frame: .zero) - public let rightLabel = Label.createLabelRegularBodySmall(true) + public let rightLabel = Label(fontStyle: .RegularBodySmall) let arrowAndRightLabelStack: Stack diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift index bb6ebd9e..9bb29582 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift @@ -14,8 +14,8 @@ import Foundation // MARK: - Outlets //----------------------------------------------------- public var stack: Stack - public let leftLabel = Label.createLabelBoldBodySmall(true) - public let rightLabel = Label.createLabelRegularBodySmall(true) + public let leftLabel = Label(fontStyle: .BoldBodySmall) + public let rightLabel = Label(fontStyle: .RegularBodySmall) public let bar = Line() //----------------------------------------------------- @@ -61,8 +61,8 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - rightLabel.styleRegularBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.RegularBodySmall) bar.setStyle(.heavy) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift index 5e7d39c6..4778fc25 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift @@ -13,9 +13,9 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //------------------------------------------------------- - public let leftLabel = Label.createLabelRegularBodySmall(true) - public let centerLabel = Label.createLabelRegularBodySmall(true) - public let rightLabel = Label.createLabelRegularBodySmall(true) + public let leftLabel = Label(fontStyle: .RegularBodySmall) + public let centerLabel = Label(fontStyle: .RegularBodySmall) + public let rightLabel = Label(fontStyle: .RegularBodySmall) var stack: Stack //------------------------------------------------------ @@ -54,8 +54,8 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleRegularBodySmall(true) - centerLabel.styleRegularBodySmall(true) - rightLabel.styleRegularBodySmall(true) + leftLabel.setFontStyle(.RegularBodySmall) + centerLabel.setFontStyle(.RegularBodySmall) + rightLabel.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift index 5fc836d1..721ea270 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift @@ -14,9 +14,9 @@ import Foundation // MARK: - Outlets //----------------------------------------------------- open var stack: Stack - public let leftLabel = Label.createLabelRegularBodySmall(true) - public let centerLabel = Label.createLabelRegularBodySmall(true) - public let rightLabel = Label.createLabelRegularBodySmall(true) + public let leftLabel = Label(fontStyle: .RegularBodySmall) + public let centerLabel = Label(fontStyle: .RegularBodySmall) + public let rightLabel = Label(fontStyle: .RegularBodySmall) public let arrow = Arrow(frame: .zero) public let arrowAndLabel2Stack: Stack @@ -66,8 +66,8 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleRegularBodySmall(true) - centerLabel.styleRegularBodySmall(true) - rightLabel.styleRegularBodySmall(true) + leftLabel.setFontStyle(.RegularBodySmall) + centerLabel.setFontStyle(.RegularBodySmall) + rightLabel.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift index e9a78f1b..8f3cf74e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift @@ -13,15 +13,15 @@ import Foundation //------------------------------------------------------- // MARK: - Outlets //------------------------------------------------------- - let leftHeadline1 = Label.createLabelBoldBodySmall(true) - let leftHeadline2 = Label.createLabelBoldBodySmall(true) - let leftHeadline3 = Label.createLabelBoldBodySmall(true) - let leftBody = Label.createLabelRegularBodySmall(true) + let leftHeadline1 = Label(fontStyle: .BoldBodySmall) + let leftHeadline2 = Label(fontStyle: .BoldBodySmall) + let leftHeadline3 = Label(fontStyle: .BoldBodySmall) + let leftBody = Label(fontStyle: .RegularBodySmall) let leftLink = Link() - let rightHeadline1 = Label.createLabelBoldBodySmall(true) - let rightHeadline2 = Label.createLabelBoldBodySmall(true) - let rightHeadline3 = Label.createLabelBoldBodySmall(true) - let rightBody = Label.createLabelRegularBodySmall(true) + let rightHeadline1 = Label(fontStyle: .BoldBodySmall) + let rightHeadline2 = Label(fontStyle: .BoldBodySmall) + let rightHeadline3 = Label(fontStyle: .BoldBodySmall) + let rightBody = Label(fontStyle: .RegularBodySmall) let rightLink = Link() let containingStack: Stack @@ -97,14 +97,14 @@ import Foundation open override func reset() { super.reset() - leftHeadline1.styleBoldBodySmall(true) - leftHeadline2.styleBoldBodySmall(true) - leftHeadline3.styleBoldBodySmall(true) - leftBody.styleRegularBodySmall(true) - rightHeadline1.styleBoldBodySmall(true) - rightHeadline2.styleBoldBodySmall(true) - rightHeadline3.styleBoldBodySmall(true) - rightBody.styleRegularBodySmall(true) + leftHeadline1.setFontStyle(.BoldBodySmall) + leftHeadline2.setFontStyle(.BoldBodySmall) + leftHeadline3.setFontStyle(.BoldBodySmall) + leftBody.setFontStyle(.RegularBodySmall) + rightHeadline1.setFontStyle(.BoldBodySmall) + rightHeadline2.setFontStyle(.BoldBodySmall) + rightHeadline3.setFontStyle(.BoldBodySmall) + rightBody.setFontStyle(.RegularBodySmall) } public override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift index ecae14e8..c0fc2c0f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift @@ -13,10 +13,10 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //------------------------------------------------------- - public let leftHeadline = Label.createLabelBoldBodySmall(true) - public let leftBody = Label.createLabelRegularBodySmall(true) - public let rightLabel = Label.createLabelRegularBodySmall(true) - public let rightSubLabel = Label.createLabelRegularBodySmall(true) + public let leftHeadline = Label(fontStyle: .BoldBodySmall) + public let leftBody = Label(fontStyle: .RegularBodySmall) + public let rightLabel = Label(fontStyle: .RegularBodySmall) + public let rightSubLabel = Label(fontStyle: .RegularBodySmall) public let view = MVMCoreUICommonViewsUtility.commonView() public let leftVerticalStack: UIStackView @@ -86,9 +86,9 @@ import Foundation super.reset() leftVerticalStack.reset() rightVerticalStack.reset() - leftHeadline.styleBoldBodySmall(true) - leftBody.styleRegularBodySmall(true) - rightLabel.styleRegularBodySmall(true) - rightSubLabel.styleRegularBodySmall(true) + leftHeadline.setFontStyle(.BoldBodySmall) + leftBody.setFontStyle(.RegularBodySmall) + rightLabel.setFontStyle(.RegularBodySmall) + rightSubLabel.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift index 3fbac0f3..263b5e27 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift @@ -10,8 +10,8 @@ import UIKit @objcMembers open class ListTwoColumnPriceDetails: TableViewCell { - let leftLabel = Label.createLabelRegularBodySmall(true) - let rightLabel = Label.createLabelRegularBodySmall(true) + let leftLabel = Label(fontStyle: .RegularBodySmall) + let rightLabel = Label(fontStyle: .RegularBodySmall) let view = MVMCoreUICommonViewsUtility.commonView() // MARK: - MFViewProtocol @@ -44,8 +44,8 @@ import UIKit super.reset() leftLabel.reset() rightLabel.reset() - leftLabel.styleRegularBodySmall(true) - rightLabel.styleRegularBodySmall(true) + leftLabel.setFontStyle(.RegularBodySmall) + rightLabel.setFontStyle(.RegularBodySmall) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift index 16b1e93e..848599e2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/ListProgressBarData.swift @@ -14,8 +14,8 @@ import UIKit // MARK: - Outlets //----------------------------------------------------- let progressBar = MultiProgress(frame: .zero) - let leftLabel = Label.createLabelBoldBodySmall(true) - let rightLabel = Label.createLabelBoldBodySmall(true) + let leftLabel = Label(fontStyle: .BoldBodySmall) + let rightLabel = Label(fontStyle: .BoldBodySmall) let view = MVMCoreUICommonViewsUtility.commonView() //----------------------------------------------------- @@ -66,8 +66,8 @@ import UIKit progressBar.reset() leftLabel.reset() rightLabel.reset() - leftLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift index f857b167..63b927c1 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/FourColumn/ListFourColumnDataUsageDivider.swift @@ -11,10 +11,10 @@ import Foundation @objcMembers open class ListFourColumnDataUsageDivider: TableViewCell { // MARK: - MFViewProtocol - let label1 = Label.createLabelBoldBodySmall(true) - let label2 = Label.createLabelBoldBodySmall(true) - let label3 = Label.createLabelBoldBodySmall(true) - let label4 = Label.createLabelBoldBodySmall(true) + let label1 = Label(fontStyle: .BoldBodySmall) + let label2 = Label(fontStyle: .BoldBodySmall) + let label3 = Label(fontStyle: .BoldBodySmall) + let label4 = Label(fontStyle: .BoldBodySmall) var stack: Stack // MARK: - Initializers @@ -55,9 +55,9 @@ import Foundation // MARK: - MoleculeViewProtocol open override func reset() { super.reset() - label1.styleBoldBodySmall(true) - label2.styleBoldBodySmall(true) - label3.styleBoldBodySmall(true) - label4.styleBoldBodySmall(true) + label1.setFontStyle(.BoldBodySmall) + label2.setFontStyle(.BoldBodySmall) + label3.setFontStyle(.BoldBodySmall) + label4.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift index 18529ebe..f0f91828 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift @@ -13,8 +13,8 @@ import Foundation // MARK: - Outlets //----------------------------------------------------- public var stack: Stack - public let headline = Label.createLabelBoldBodySmall(true) - public let body = Label.createLabelRegularBodySmall(true) + public let headline = Label(fontStyle: .BoldBodySmall) + public let body = Label(fontStyle: .BoldBodySmall) // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -50,7 +50,7 @@ import Foundation open override func reset() { super.reset() - headline.styleBoldBodySmall(true) - body.styleRegularBodySmall(true) + headline.setFontStyle(.BoldBodySmall) + body.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift index 3198a72d..7aeeaa15 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift @@ -13,8 +13,8 @@ import Foundation // MARK: - Outlets //----------------------------------------------------- public var stack: Stack - public let headline = Label.createLabelBoldTitleMedium(true) - public let body = Label.createLabelRegularBodySmall(true) + public let headline = Label(fontStyle: .BoldTitleMedium) + public let body = Label(fontStyle: .RegularBodySmall) // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -50,7 +50,7 @@ import Foundation open override func reset() { super.reset() - headline.styleBoldTitleMedium(true) - body.styleRegularBodySmall(true) + headline.setFontStyle(.BoldTitleMedium) + body.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index d725ff61..5f5227f9 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -13,8 +13,8 @@ import Foundation // MARK: - Outlets //----------------------------------------------------- public var stack: Stack - public let headline = Label.createLabelBoldTitleMedium(true) - public let body = Label.createLabelRegularBodySmall(true) + public let headline = Label(fontStyle: .BoldTitleMedium) + public let body = Label(fontStyle: .RegularBodySmall) // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -50,7 +50,7 @@ import Foundation open override func reset() { super.reset() - headline.styleBoldTitleMedium(true) + headline.setFontStyle(.BoldTitleMedium) body.styleRegularBodySmall(true) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillChangesDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillChangesDivider.swift index a8d80219..876608d8 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillChangesDivider.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillChangesDivider.swift @@ -9,9 +9,9 @@ import Foundation @objcMembers open class ListThreeColumnBillChangesDivider: TableViewCell { - public let leftLabel = Label.createLabelBoldBodySmall(true) - public let centerLabel = Label.createLabelBoldBodySmall(true) - public let rightLabel = Label.createLabelBoldBodySmall(true) + public let leftLabel = Label(fontStyle: .BoldBodySmall) + public let centerLabel = Label(fontStyle: .BoldBodySmall) + public let rightLabel = Label(fontStyle: .BoldBodySmall) var stack: Stack // MARK: - Initializers @@ -49,8 +49,8 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - centerLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + centerLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnDataUsageDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnDataUsageDivider.swift index eab5e8be..9393d026 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnDataUsageDivider.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnDataUsageDivider.swift @@ -13,9 +13,9 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //------------------------------------------------------- - public let leftLabel = Label.createLabelBoldBodySmall(true) - public let centerLabel = Label.createLabelBoldBodySmall(true) - public let rightLabel = Label.createLabelBoldBodySmall(true) + public let leftLabel = Label(fontStyle: .BoldBodySmall) + public let centerLabel = Label(fontStyle: .BoldBodySmall) + public let rightLabel = Label(fontStyle: .BoldBodySmall) var stack: Stack //------------------------------------------------------ @@ -54,8 +54,8 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - centerLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + centerLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift index 7b6af23d..79a9498d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDivider.swift @@ -13,9 +13,9 @@ import Foundation //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - let leftLabel = Label.createLabelBoldBodySmall(true) - let centerLabel = Label.createLabelBoldBodySmall(true) - let rightLabel = Label.createLabelBoldBodySmall(true) + let leftLabel = Label(fontStyle: .BoldBodySmall) + let centerLabel = Label(fontStyle: .BoldBodySmall) + let rightLabel = Label(fontStyle: .BoldBodySmall) var stack: Stack public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -59,8 +59,8 @@ import Foundation //----------------------------------------------------- override open func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - centerLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + centerLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift index aa9fbc2d..cb622256 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnSpeedTestDivider.swift @@ -13,9 +13,9 @@ import Foundation //------------------------------------------------------- // MARK: - Outlets //------------------------------------------------------- - let leftLabel = Label.createLabelBoldBodySmall(true) - let centerLabel = Label.createLabelBoldBodySmall(true) - let rightLabel = Label.createLabelBoldBodySmall(true) + let leftLabel = Label(fontStyle: .BoldBodySmall) + let centerLabel = Label(fontStyle: .BoldBodySmall) + let rightLabel = Label(fontStyle: .BoldBodySmall) var stack: Stack //------------------------------------------------------- @@ -56,8 +56,8 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - centerLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + centerLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnSubsectionDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnSubsectionDivider.swift index d26da0f4..2b46daae 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnSubsectionDivider.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/TwoColumn/ListTwoColumnSubsectionDivider.swift @@ -13,8 +13,8 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let leftLabel = Label.createLabelBoldBodySmall(true) - let rightLabel = Label.createLabelBoldBodySmall(true) + let leftLabel = Label(fontStyle: .BoldBodySmall) + let rightLabel = Label(fontStyle: .BoldBodySmall) var stack: Stack //------------------------------------------------------- @@ -56,7 +56,7 @@ import Foundation open override func reset() { super.reset() - leftLabel.styleBoldBodySmall(true) - rightLabel.styleBoldBodySmall(true) + leftLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/Doughnut/ColorViewWithLabel.swift b/MVMCoreUI/Atomic/Molecules/Doughnut/ColorViewWithLabel.swift index f8dd4b5c..b9b3a4a4 100644 --- a/MVMCoreUI/Atomic/Molecules/Doughnut/ColorViewWithLabel.swift +++ b/MVMCoreUI/Atomic/Molecules/Doughnut/ColorViewWithLabel.swift @@ -14,7 +14,7 @@ open class ColorViewWithLabel: View { // MARK: - Properties //-------------------------------------------------- - public var label = Label.createLabelRegularBodySmall(true) + public var label = Label(fontStyle: .RegularBodySmall, true) public var colorView = View() private var sizeObject = MFStyler.sizeObjectGeneric(forCurrentDevice: 8)! diff --git a/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift b/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift index bad0492d..649c9c5e 100644 --- a/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift +++ b/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift @@ -15,8 +15,8 @@ open class DoughnutChart: View { //-------------------------------------------------- public var doughnutLayer = CALayer() - public var titleLabel = Label.createLabelBoldTitleLarge(true) - public var subTitleLabel = Label.createLabelRegularMicro(true) + public var titleLabel = Label(fontStyle: .BoldTitleLarge, true) + public var subTitleLabel = Label(fontStyle: .RegularMicro, true) public var labelContainer = MVMCoreUICommonViewsUtility.commonView() public static let heightConstant: CGFloat = 136 private var sizeObject = MFStyler.sizeObjectGeneric(forCurrentDevice: heightConstant)! diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/ImageHeadlineBody.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/ImageHeadlineBody.swift index ff770da3..6f2e1960 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/ImageHeadlineBody.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/ImageHeadlineBody.swift @@ -18,7 +18,7 @@ import UIKit open override func setupView() { super.setupView() - headlineBody.headlineLabel.styleBoldBodySmall(true) + headlineBody.headlineLabel.setFontStyle(.BoldBodySmall) headlineBody.spaceBetweenLabelsConstant = 0 imageView.addSizeConstraintsForAspectRatio = true @@ -43,7 +43,7 @@ import UIKit open override func reset() { super.reset() headlineBody.reset() - headlineBody.headlineLabel.styleBoldBodySmall(true) + headlineBody.headlineLabel.setFontStyle(.BoldBodySmall) headlineBody.spaceBetweenLabelsConstant = 0 imageView.reset() } diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabels.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabels.swift index 5751fbc2..be3ac62e 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabels.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabels.swift @@ -10,10 +10,10 @@ import UIKit @objcMembers public class CornerLabels: View { var middleView: UIView? - let topLeftLabel = Label.createLabelBoldBodySmall(true) - let topRightLabel = Label.createLabelBoldBodySmall(true) - let bottomLeftLabel = Label.createLabelRegularMicro(true) - let bottomRightLabel = Label.createLabelRegularMicro(true) + let topLeftLabel = Label(fontStyle: .BoldBodySmall) + let topRightLabel = Label(fontStyle: .BoldBodySmall) + let bottomLeftLabel = Label(fontStyle: .RegularMicro) + let bottomRightLabel = Label(fontStyle: .RegularMicro) let topLabelsView = MVMCoreUICommonViewsUtility.commonView() let bottomLabelsView = MVMCoreUICommonViewsUtility.commonView() @@ -151,10 +151,10 @@ import UIKit } func styleDefault() { - topLeftLabel.styleBoldBodySmall(true) - topRightLabel.styleBoldBodySmall(true) - bottomLeftLabel.styleRegularMicro(true) - bottomRightLabel.styleRegularMicro(true) + topLeftLabel.setFontStyle(.BoldBodySmall) + topRightLabel.setFontStyle(.BoldBodySmall) + bottomLeftLabel.setFontStyle(.RegularMicro) + bottomRightLabel.setFontStyle(.RegularMicro) } public class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift index 3ff3a41f..5611984f 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift @@ -14,7 +14,7 @@ import UIKit // MARK: - Properties //-------------------------------------------------- - public let label = Label.createLabelBoldBodySmall(true) + public let label = Label(fontStyle: .BoldBodySmall) public let toggle = Toggle() //-------------------------------------------------- @@ -58,6 +58,6 @@ import UIKit super.reset() label.reset() toggle.reset() - label.styleBoldBodySmall(true) + label.setFontStyle(.BoldBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index 9ad26015..67a56291 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -14,9 +14,9 @@ import UIKit //-------------------------------------------------- public let stack = Stack(frame: .zero) - public let eyebrow = Label.createLabelRegularMicro(true) - public let headline = Label.createLabelBoldBodySmall(true) - public let body = Label.createLabelRegularBodySmall(true) + public let eyebrow = Label(fontStyle: .RegularMicro) + public let headline = Label(fontStyle: .BoldBodySmall) + public let body = Label(fontStyle: .RegularBodySmall, true) public let link = Link() var castModel: EyebrowHeadlineBodyLinkModel? { @@ -48,9 +48,9 @@ import UIKit open override func reset() { super.reset() stack.reset() - eyebrow.styleRegularMicro(true) - headline.styleBoldBodySmall(true) - body.styleRegularBodySmall(true) + eyebrow.setFontStyle(.RegularMicro) + headline.setFontStyle(.RegularMicro) + body.setFontStyle(.RegularBodySmall) } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift index 4e9b97dd..93b6fa68 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBody.swift @@ -10,8 +10,8 @@ import UIKit open class HeadlineBody: View { - let headlineLabel = Label.createLabelBoldTitleLarge(true) - let messageLabel = Label.createLabelRegularBodySmall(true) + let headlineLabel = Label(fontStyle: .BoldTitleLarge) + let messageLabel = Label(fontStyle: .RegularBodySmall) var spaceBetweenLabelsConstant = PaddingOne var spaceBetweenLabels: NSLayoutConstraint? var leftConstraintTitle: NSLayoutConstraint? @@ -39,26 +39,26 @@ open class HeadlineBody: View { } func styleLandingPageHeader() { - headlineLabel.styleTitle2XLarge(true) - messageLabel.styleRegularBodySmall(true) + headlineLabel.setFontStyle(.Title2XLarge) + messageLabel.setFontStyle(.RegularBodySmall) spaceBetweenLabelsConstant = PaddingTwo } func stylePageHeader() { - headlineLabel.styleBoldTitleLarge(true) - messageLabel.styleRegularBodySmall(true) + headlineLabel.setFontStyle(.BoldTitleLarge) + messageLabel.setFontStyle(.RegularBodySmall) spaceBetweenLabelsConstant = PaddingOne } func styleListItem() { - headlineLabel.styleBoldBodySmall(true) - messageLabel.styleRegularBodySmall(true) + headlineLabel.setFontStyle(.BoldBodySmall) + messageLabel.setFontStyle(.RegularBodySmall) spaceBetweenLabelsConstant = 0 } func styleListItemDivider() { - headlineLabel.styleBoldTitleMedium(true) - messageLabel.styleRegularBodySmall(true) + headlineLabel.setFontStyle(.BoldTitleMedium) + messageLabel.setFontStyle(.RegularBodySmall) spaceBetweenLabelsConstant = 0 } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeView.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeView.swift index 30a82134..3c97e988 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeView.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeView.swift @@ -9,7 +9,7 @@ import Foundation open class StringAndMoleculeView: View { - var label = Label.createLabelRegularBodySmall(true) + var label = Label(fontStyle: .RegularBodySmall) var molecule: MoleculeViewProtocol var leftWidthConstraint: NSLayoutConstraint? From 6f23ee6c9940f17e49deea186433d5ccc45af5c1 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 5 Jun 2020 09:43:51 -0400 Subject: [PATCH 2/9] comments and code removal --- .../Atomic/Atoms/Views/Label/Label.swift | 72 ++----------------- ...eColumnTextWithWhitespaceDividerTall.swift | 2 +- .../EyebrowHeadlineBodyLink.swift | 2 +- 3 files changed, 9 insertions(+), 67 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 14250f30..abc37c43 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -147,7 +147,7 @@ public typealias ActionBlock = () -> () } //------------------------------------------------------ - // MARK: - Factory Functions + // MARK: - 2.0 Factory Functions //------------------------------------------------------ //2.0 fonts init methods @@ -495,7 +495,7 @@ public typealias ActionBlock = () -> () } //------------------------------------------------------ - // MARK: - Methods + // MARK: - 3.0 Styling Method //------------------------------------------------------ public func setFontStyle(_ fontStyle: Styler.Font, _ scale: Bool = true) { @@ -503,69 +503,11 @@ public typealias ActionBlock = () -> () textColor = .mvmBlack setScale(scale) } - - //mva 3.0 font - @objc public func styleTitle2XLarge(_ scale: Bool) { - MFStyler.styleLabelTitle2XLarge(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleTitleXLarge(_ scale: Bool) { - MFStyler.styleLabelTitleXLarge(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleBoldTitleLarge(_ scale: Bool) { - MFStyler.styleLabelBoldTitleLarge(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleRegularTitleLarge(_ scale: Bool) { - MFStyler.styleLabelRegularTitleLarge(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleBoldTitleMedium(_ scale: Bool) { - MFStyler.styleLabelBoldTitleMedium(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleRegularTitleMedium(_ scale: Bool) { - MFStyler.styleLabelRegularTitleMedium(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleBoldBodyLarge(_ scale: Bool) { - MFStyler.styleLabelBoldBodyLarge(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleRegularBodyLarge(_ scale: Bool) { - MFStyler.styleLabelRegularBodyLarge(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleBoldBodySmall(_ scale: Bool) { - MFStyler.styleLabelBoldBodySmall(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleRegularBodySmall(_ scale: Bool) { - MFStyler.styleLabelRegularBodySmall(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleBoldMicro(_ scale: Bool) { - MFStyler.styleLabelBoldMicro(self, genericScaling: false) - setScale(scale) - } - - @objc public func styleRegularMicro(_ scale: Bool) { - MFStyler.styleLabelRegularMicro(self, genericScaling: false) - setScale(scale) - } - - //2.0 fonts + + //------------------------------------------------------ + // MARK: - 2.0 Styling Methods + //------------------------------------------------------ + @objc public func styleH1(_ scale: Bool) { MFStyler.styleLabelH1(self, genericScaling: false) setScale(scale) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index 5f5227f9..e0182f05 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -51,6 +51,6 @@ import Foundation open override func reset() { super.reset() headline.setFontStyle(.BoldTitleMedium) - body.styleRegularBodySmall(true) + body.setFontStyle(.RegularBodySmall) } } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index 67a56291..7d176ba2 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -49,7 +49,7 @@ import UIKit super.reset() stack.reset() eyebrow.setFontStyle(.RegularMicro) - headline.setFontStyle(.RegularMicro) + headline.setFontStyle(.BoldBodySmall) body.setFontStyle(.RegularBodySmall) } From f245d0c32170ae0b206e3ced848f95a19988c84a Mon Sep 17 00:00:00 2001 From: "Murugan, Vimal" Date: Mon, 8 Jun 2020 19:44:45 +0530 Subject: [PATCH 3/9] carousel itemILC added --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Molecules/Items/CarouselItemILC.swift | 71 +++++++++++++++++++ .../Items/CarouselItemILCModel.swift | 61 ++++++++++++++++ 4 files changed, 141 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift create mode 100644 MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 331da73c..b9dc159f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -241,6 +241,8 @@ C695A69423C9909000BFB94E /* DoughnutChartModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A69323C9909000BFB94E /* DoughnutChartModel.swift */; }; C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A69523C990BC00BFB94E /* DoughnutChart.swift */; }; C695A69823C990C200BFB94E /* DoughnutChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A69723C990C200BFB94E /* DoughnutChartView.swift */; }; + C6A4920F248E17EB00643D3F /* CarouselItemILCModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A4920E248E17EB00643D3F /* CarouselItemILCModel.swift */; }; + C6A49211248E180600643D3F /* CarouselItemILC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A49210248E180600643D3F /* CarouselItemILC.swift */; }; C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6FA7D4F23C77A4700A3614A /* UnOrderedList.swift */; }; C6FA7D5323C77A4A00A3614A /* StringAndMoleculeStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6FA7D5023C77A4800A3614A /* StringAndMoleculeStack.swift */; }; C6FA7D5423C77A4A00A3614A /* NumberedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6FA7D5123C77A4900A3614A /* NumberedList.swift */; }; @@ -678,6 +680,8 @@ C695A69323C9909000BFB94E /* DoughnutChartModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DoughnutChartModel.swift; sourceTree = ""; }; C695A69523C990BC00BFB94E /* DoughnutChart.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DoughnutChart.swift; sourceTree = ""; }; C695A69723C990C200BFB94E /* DoughnutChartView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DoughnutChartView.swift; sourceTree = ""; }; + C6A4920E248E17EB00643D3F /* CarouselItemILCModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselItemILCModel.swift; sourceTree = ""; }; + C6A49210248E180600643D3F /* CarouselItemILC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselItemILC.swift; sourceTree = ""; }; C6FA7D4F23C77A4700A3614A /* UnOrderedList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedList.swift; sourceTree = ""; }; C6FA7D5023C77A4800A3614A /* StringAndMoleculeStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeStack.swift; sourceTree = ""; }; C6FA7D5123C77A4900A3614A /* NumberedList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberedList.swift; sourceTree = ""; }; @@ -1284,6 +1288,8 @@ D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */, 012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */, D21B7F74243BAC8900051ABF /* CarouselItem.swift */, + C6A4920E248E17EB00643D3F /* CarouselItemILCModel.swift */, + C6A49210248E180600643D3F /* CarouselItemILC.swift */, ); path = Items; sourceTree = ""; @@ -2096,6 +2102,7 @@ 01EB369423609801006832FA /* HeadlineBodyModel.swift in Sources */, D2A92884241ACB25004E01C6 /* ProgrammaticScrollViewController.swift in Sources */, 0A21DB7F235DECC500C160A2 /* EntryField.swift in Sources */, + C6A49211248E180600643D3F /* CarouselItemILC.swift in Sources */, D2E2A99F23E07F8A000B42E6 /* PillButton.swift in Sources */, D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */, D29DF12E21E6851E003B2FB9 /* MVMCoreUITopAlertView.m in Sources */, @@ -2128,6 +2135,7 @@ 94C0150C2421564A005811A9 /* ActionCollapseNotificationModel.swift in Sources */, 014AA73123C5059B006F3E93 /* ListPageTemplateModel.swift in Sources */, D29DF2A221E7AF4E003B2FB9 /* MVMCoreUIUtility.m in Sources */, + C6A4920F248E17EB00643D3F /* CarouselItemILCModel.swift in Sources */, D29DF12B21E6851E003B2FB9 /* MVMCoreUITopAlertExpandableView.m in Sources */, 94C2D9A723872DA90006CF46 /* LabelAttributeColorModel.swift in Sources */, 943820842432382400B43AF3 /* WebView.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 4f151642..1602bd8d 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -134,6 +134,7 @@ 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) + MoleculeObjectMapping.shared()?.register(viewClass: CarouselItemILC.self, viewModelClass: CarouselItemILCModel.self) // Other Container Molecules diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift new file mode 100644 index 00000000..548de74f --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift @@ -0,0 +1,71 @@ +// +// CarouselItemILC.swift +// MVMCoreUI +// +// Created by Murugan, Vimal on 08/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class CarouselItemILC: CollectionViewCell { + + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public let image = LoadImageView(frame: .zero) + public let label = Label(frame: .zero) + public let caretLink = CaretLink(frame: .zero) + public var stack: Stack + + public override init(frame: CGRect) { + stack = Stack.createStack(with: [ + (view: image, model: StackItemModel(horizontalAlignment: .fill)), + (view: label, model: StackItemModel(spacing: 6.0, horizontalAlignment: .fill)), + (view: caretLink, model: StackItemModel(spacing:52.0, horizontalAlignment: .leading, verticalAlignment: .trailing))], + axis: .vertical) + super.init(frame: frame) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + open override func setupView() { + super.setupView() + addMolecule(stack) + stack.restack() + // Make the whole cell focusable. + isAccessibilityElement = true + caretLink.isAccessibilityElement = false + accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? CarouselItemILCModel else { return } + stack.updateContainedMolecules(with: [model.image, model.label, model.caretLink], + delegateObject, additionalData) + + updateAccessibilityLabel() + } + + public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + guard let action = (model as? CarouselItemILCModel)?.caretLink.action else { return } + Button.performButtonAction(with: action, button: self, delegateObject: delegateObject, additionalData: additionalData) + } + + func updateAccessibilityLabel() { + var message = "" + if let labelText = label.accessibilityLabel { + message += labelText + ", " + } + + if let caretLinkText = caretLink.titleLabel?.text { + message += caretLinkText + } + accessibilityLabel = message + } + +} diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift new file mode 100644 index 00000000..dad7551c --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift @@ -0,0 +1,61 @@ +// +// CarouselItemILCModel.swift +// MVMCoreUI +// +// Created by Murugan, Vimal on 08/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers public class CarouselItemILCModel: ContainerModel, MoleculeModelProtocol, CarouselItemModelProtocol, CollectionItemModelProtocol { + + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public var backgroundColor: Color? + public var image: ImageViewModel + public var label: LabelModel + public var caretLink: CaretLinkModel + + public class var identifier: String { + return "carouselItemILC" + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case label + case image + case caretLink + } + + //-------------------------------------------------- + // 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) + image = try typeContainer.decode(ImageViewModel.self, forKey: .image) + label = try typeContainer.decode(LabelModel.self, forKey: .label) + caretLink = try typeContainer.decode(CaretLinkModel.self, forKey: .caretLink) + 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.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(image, forKey: .image) + try container.encode(label, forKey: .label) + try container.encode(caretLink, forKey: .caretLink) + try container.encode(moleculeName, forKey: .moleculeName) + } + +} From f730d58aa38a092abca0dbe12b8a1ac4870d9d6f Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 8 Jun 2020 10:45:52 -0400 Subject: [PATCH 4/9] error correction --- ...stRightVariablePriceChangeAllTextAndLinks.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index aef75633..72499f2e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -8,14 +8,15 @@ import Foundation + @objcMembers open class ListRightVariablePriceChangeAllTextAndLinks: TableViewCell { - //----------------------------------------------------- // MARK: - Outlets //----------------------------------------------------- - public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero) - public let arrow = Arrow(frame: .zero) - public let rightLabel = Label(fontStyle: .Title2XLarge) + + public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() + public let arrow = Arrow() + public let rightLabel = Label(fontStyle: .RegularBodySmall) private let stack: Stack private let arrowStackItem: StackItem private let rightLabelStackItem: StackItem @@ -67,9 +68,11 @@ 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? ListRightVariablePriceChangeAllTextAndLinksModel else { return } + eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) arrow.set(with: model.arrow, delegateObject, additionalData) @@ -79,4 +82,3 @@ import Foundation return 121 } } - From 1a2266af10d1f5e19ccc9fdc15b9eb86ebadb474 Mon Sep 17 00:00:00 2001 From: "Murugan, Vimal" Date: Mon, 8 Jun 2020 21:10:45 +0530 Subject: [PATCH 5/9] mark didselectcell as open --- MVMCoreUI.xcodeproj/project.pbxproj | 8 --- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 - .../Molecules/Items/CarouselItemILC.swift | 71 ------------------- .../Items/CarouselItemILCModel.swift | 61 ---------------- .../BaseClasses/CollectionViewCell.swift | 2 +- 5 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift delete mode 100644 MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index b9dc159f..331da73c 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -241,8 +241,6 @@ C695A69423C9909000BFB94E /* DoughnutChartModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A69323C9909000BFB94E /* DoughnutChartModel.swift */; }; C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A69523C990BC00BFB94E /* DoughnutChart.swift */; }; C695A69823C990C200BFB94E /* DoughnutChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A69723C990C200BFB94E /* DoughnutChartView.swift */; }; - C6A4920F248E17EB00643D3F /* CarouselItemILCModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A4920E248E17EB00643D3F /* CarouselItemILCModel.swift */; }; - C6A49211248E180600643D3F /* CarouselItemILC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A49210248E180600643D3F /* CarouselItemILC.swift */; }; C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6FA7D4F23C77A4700A3614A /* UnOrderedList.swift */; }; C6FA7D5323C77A4A00A3614A /* StringAndMoleculeStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6FA7D5023C77A4800A3614A /* StringAndMoleculeStack.swift */; }; C6FA7D5423C77A4A00A3614A /* NumberedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6FA7D5123C77A4900A3614A /* NumberedList.swift */; }; @@ -680,8 +678,6 @@ C695A69323C9909000BFB94E /* DoughnutChartModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DoughnutChartModel.swift; sourceTree = ""; }; C695A69523C990BC00BFB94E /* DoughnutChart.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DoughnutChart.swift; sourceTree = ""; }; C695A69723C990C200BFB94E /* DoughnutChartView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DoughnutChartView.swift; sourceTree = ""; }; - C6A4920E248E17EB00643D3F /* CarouselItemILCModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselItemILCModel.swift; sourceTree = ""; }; - C6A49210248E180600643D3F /* CarouselItemILC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselItemILC.swift; sourceTree = ""; }; C6FA7D4F23C77A4700A3614A /* UnOrderedList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedList.swift; sourceTree = ""; }; C6FA7D5023C77A4800A3614A /* StringAndMoleculeStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeStack.swift; sourceTree = ""; }; C6FA7D5123C77A4900A3614A /* NumberedList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberedList.swift; sourceTree = ""; }; @@ -1288,8 +1284,6 @@ D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */, 012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */, D21B7F74243BAC8900051ABF /* CarouselItem.swift */, - C6A4920E248E17EB00643D3F /* CarouselItemILCModel.swift */, - C6A49210248E180600643D3F /* CarouselItemILC.swift */, ); path = Items; sourceTree = ""; @@ -2102,7 +2096,6 @@ 01EB369423609801006832FA /* HeadlineBodyModel.swift in Sources */, D2A92884241ACB25004E01C6 /* ProgrammaticScrollViewController.swift in Sources */, 0A21DB7F235DECC500C160A2 /* EntryField.swift in Sources */, - C6A49211248E180600643D3F /* CarouselItemILC.swift in Sources */, D2E2A99F23E07F8A000B42E6 /* PillButton.swift in Sources */, D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */, D29DF12E21E6851E003B2FB9 /* MVMCoreUITopAlertView.m in Sources */, @@ -2135,7 +2128,6 @@ 94C0150C2421564A005811A9 /* ActionCollapseNotificationModel.swift in Sources */, 014AA73123C5059B006F3E93 /* ListPageTemplateModel.swift in Sources */, D29DF2A221E7AF4E003B2FB9 /* MVMCoreUIUtility.m in Sources */, - C6A4920F248E17EB00643D3F /* CarouselItemILCModel.swift in Sources */, D29DF12B21E6851E003B2FB9 /* MVMCoreUITopAlertExpandableView.m in Sources */, 94C2D9A723872DA90006CF46 /* LabelAttributeColorModel.swift in Sources */, 943820842432382400B43AF3 /* WebView.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 1602bd8d..4f151642 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -134,7 +134,6 @@ 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) - MoleculeObjectMapping.shared()?.register(viewClass: CarouselItemILC.self, viewModelClass: CarouselItemILCModel.self) // Other Container Molecules diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift deleted file mode 100644 index 548de74f..00000000 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILC.swift +++ /dev/null @@ -1,71 +0,0 @@ -// -// CarouselItemILC.swift -// MVMCoreUI -// -// Created by Murugan, Vimal on 08/06/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers open class CarouselItemILC: CollectionViewCell { - - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - - public let image = LoadImageView(frame: .zero) - public let label = Label(frame: .zero) - public let caretLink = CaretLink(frame: .zero) - public var stack: Stack - - public override init(frame: CGRect) { - stack = Stack.createStack(with: [ - (view: image, model: StackItemModel(horizontalAlignment: .fill)), - (view: label, model: StackItemModel(spacing: 6.0, horizontalAlignment: .fill)), - (view: caretLink, model: StackItemModel(spacing:52.0, horizontalAlignment: .leading, verticalAlignment: .trailing))], - axis: .vertical) - super.init(frame: frame) - } - - public required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - open override func setupView() { - super.setupView() - addMolecule(stack) - stack.restack() - // Make the whole cell focusable. - isAccessibilityElement = true - caretLink.isAccessibilityElement = false - accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") - } - - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { - super.set(with: model, delegateObject, additionalData) - guard let model = model as? CarouselItemILCModel else { return } - stack.updateContainedMolecules(with: [model.image, model.label, model.caretLink], - delegateObject, additionalData) - - updateAccessibilityLabel() - } - - public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { - guard let action = (model as? CarouselItemILCModel)?.caretLink.action else { return } - Button.performButtonAction(with: action, button: self, delegateObject: delegateObject, additionalData: additionalData) - } - - func updateAccessibilityLabel() { - var message = "" - if let labelText = label.accessibilityLabel { - message += labelText + ", " - } - - if let caretLinkText = caretLink.titleLabel?.text { - message += caretLinkText - } - accessibilityLabel = message - } - -} diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift deleted file mode 100644 index dad7551c..00000000 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemILCModel.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// CarouselItemILCModel.swift -// MVMCoreUI -// -// Created by Murugan, Vimal on 08/06/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers public class CarouselItemILCModel: ContainerModel, MoleculeModelProtocol, CarouselItemModelProtocol, CollectionItemModelProtocol { - - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - - public var backgroundColor: Color? - public var image: ImageViewModel - public var label: LabelModel - public var caretLink: CaretLinkModel - - public class var identifier: String { - return "carouselItemILC" - } - - //-------------------------------------------------- - // MARK: - Keys - //-------------------------------------------------- - - private enum CodingKeys: String, CodingKey { - case moleculeName - case backgroundColor - case label - case image - case caretLink - } - - //-------------------------------------------------- - // 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) - image = try typeContainer.decode(ImageViewModel.self, forKey: .image) - label = try typeContainer.decode(LabelModel.self, forKey: .label) - caretLink = try typeContainer.decode(CaretLinkModel.self, forKey: .caretLink) - 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.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - try container.encode(image, forKey: .image) - try container.encode(label, forKey: .label) - try container.encode(caretLink, forKey: .caretLink) - try container.encode(moleculeName, forKey: .moleculeName) - } - -} diff --git a/MVMCoreUI/BaseClasses/CollectionViewCell.swift b/MVMCoreUI/BaseClasses/CollectionViewCell.swift index 848509c9..5f464f2d 100644 --- a/MVMCoreUI/BaseClasses/CollectionViewCell.swift +++ b/MVMCoreUI/BaseClasses/CollectionViewCell.swift @@ -98,7 +98,7 @@ open class CollectionViewCell: UICollectionViewCell, MoleculeViewProtocol, MVMCo } // MARK: - Override - public func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + open func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { guard let action = model?.action else { return } Button.performButtonAction(with: action, button: self, delegateObject: delegateObject, additionalData: additionalData) } From 24fc03406ade305f128ee33099b4cb8e890bd6a8 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 8 Jun 2020 13:14:11 -0400 Subject: [PATCH 6/9] correction --- .../ListOneColumnFullWidthTextDividerSubsection.swift | 2 +- MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift index f0f91828..8261a28a 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnFullWidthTextDividerSubsection.swift @@ -14,7 +14,7 @@ import Foundation //----------------------------------------------------- public var stack: Stack public let headline = Label(fontStyle: .BoldBodySmall) - public let body = Label(fontStyle: .BoldBodySmall) + public let body = Label(fontStyle: .RegularBodySmall) // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { diff --git a/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift b/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift index 649c9c5e..3b59ded3 100644 --- a/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift +++ b/MVMCoreUI/Atomic/Molecules/Doughnut/DoughnutChart.swift @@ -15,8 +15,8 @@ open class DoughnutChart: View { //-------------------------------------------------- public var doughnutLayer = CALayer() - public var titleLabel = Label(fontStyle: .BoldTitleLarge, true) - public var subTitleLabel = Label(fontStyle: .RegularMicro, true) + public var titleLabel = Label(fontStyle: .BoldTitleLarge) + public var subTitleLabel = Label(fontStyle: .RegularMicro) public var labelContainer = MVMCoreUICommonViewsUtility.commonView() public static let heightConstant: CGFloat = 136 private var sizeObject = MFStyler.sizeObjectGeneric(forCurrentDevice: heightConstant)! From 81d3b818e3ea8bbe31dbeef2b3522fe98c701877 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 8 Jun 2020 13:32:31 -0400 Subject: [PATCH 7/9] making use of Styler --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index abc37c43..73de7760 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -121,7 +121,7 @@ public typealias ActionBlock = () -> () setupView() font = fontStyle.getFont(false) - textColor = .mvmBlack + textColor = fontStyle.color() setScale(scale) } From 9f547669f6b7a9f8aa4f76bfdb597e01210c585f Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 8 Jun 2020 14:43:38 -0400 Subject: [PATCH 8/9] Minor cleaning --- MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift | 5 ++++- MVMCoreUI/Atomic/Atoms/Views/LineModel.swift | 6 ++++++ MVMCoreUI/BaseControllers/ViewController.swift | 2 +- MVMCoreUI/FormUIHelpers/FormValidator.swift | 12 ++++++------ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift b/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift index d5ba0a14..637b074d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift @@ -21,8 +21,11 @@ import Foundation public var contentMode: UIView.ContentMode? public var localBundle: Bundle? - public init(image: String) { + public init(image: String, imageFormat: String? = nil, width: CGFloat? = nil, height: CGFloat? = nil) { self.image = image + self.imageFormat = imageFormat + self.width = width + self.height = height } private enum CodingKeys: String, CodingKey { diff --git a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift index 3189deab..0f67b3f0 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift @@ -71,6 +71,12 @@ import UIKit self.useVerticalLine = false } + public init(verticalLineOf type: Style, backgroundColor: Color? = nil) { + self.type = type + self.backgroundColor = backgroundColor + self.useVerticalLine = true + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 717a5761..395587ec 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -263,7 +263,7 @@ import UIKit // MARK: - TabBar open func updateTabBar() { guard MVMCoreUISplitViewController.main()?.getCurrentDetailViewController() == self, - var tabModel = pageModel as? TabPageModelProtocol else { return } + let tabModel = pageModel as? TabPageModelProtocol else { return } if let index = tabModel.tabBarIndex { MVMCoreUISplitViewController.main()?.tabBar?.highlightTab(at: index) } diff --git a/MVMCoreUI/FormUIHelpers/FormValidator.swift b/MVMCoreUI/FormUIHelpers/FormValidator.swift index 744304ba..0ece4b4b 100644 --- a/MVMCoreUI/FormUIHelpers/FormValidator.swift +++ b/MVMCoreUI/FormUIHelpers/FormValidator.swift @@ -15,12 +15,12 @@ import MVMCore // MARK: - Properties //-------------------------------------------------- - static var defaultGroupName: String = "default" - var formRules: [FormGroupRule]? - weak var delegate: FormHolderProtocol? - var fields: [String: FormFieldProtocol] = [:] - var groupWatchers: [FormGroupWatcherFieldProtocol] = [] - var radioButtonsModelByGroup: [String: RadioButtonSelectionHelper] = [:] + public static var defaultGroupName: String = "default" + public var formRules: [FormGroupRule]? + public weak var delegate: FormHolderProtocol? + public var fields: [String: FormFieldProtocol] = [:] + public var groupWatchers: [FormGroupWatcherFieldProtocol] = [] + public var radioButtonsModelByGroup: [String: RadioButtonSelectionHelper] = [:] //-------------------------------------------------- // MARK: - Initializer From ee029aa103902af3d0626427f0d95fe0d99839b4 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 8 Jun 2020 17:10:54 -0400 Subject: [PATCH 9/9] matching change in label --- MVMCoreUI/Atomic/Atoms/FormFields/Tags/Tag.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/Tags/Tag.swift b/MVMCoreUI/Atomic/Atoms/FormFields/Tags/Tag.swift index c962f8c9..bc905a79 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/Tags/Tag.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/Tags/Tag.swift @@ -8,11 +8,18 @@ import Foundation + @objcMembers open class Tag: View { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- - public let label = Label.createLabelRegularBodySmall(true) + public let label = Label(fontStyle: .RegularBodySmall) + //-------------------------------------------------- // MARK: - MVMCoreViewProtocol + //-------------------------------------------------- + open override func setupView() { super.setupView() layer.borderColor = UIColor.mvmCoolGray6.cgColor @@ -22,9 +29,10 @@ import Foundation NSLayoutConstraint.constraintPinSubview(label, pinTop: true, topConstant: 13, pinBottom: true, bottomConstant: 13, pinLeft: true, leftConstant: 15, pinRight: true, rightConstant: 15) } - // MARK: - MoleculeViewProtocol open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + guard let model = model as? TagModel else { return } + label.set(with: model.label, delegateObject, additionalData) } @@ -36,6 +44,6 @@ import Foundation open override func reset() { super.reset() label.reset() - label.styleRegularBodySmall(true) + label.setFontStyle(.RegularBodySmall) } }