diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 0e6c037d..93eb5754 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -67,14 +67,12 @@ open class LabelBase: UILabel, ModelHandlerable, ViewProt //-------------------------------------------------- // MARK: - Configuration Properties //-------------------------------------------------- - private var textColorConfiguration: DisabledSurfaceColorConfiguration = { - return DisabledSurfaceColorConfiguration().with { - $0.disabled.lightColor = VDSColor.elementsSecondaryOnlight - $0.disabled.darkColor = VDSColor.elementsSecondaryOndark - $0.enabled.lightColor = VDSColor.elementsPrimaryOnlight - $0.enabled.darkColor = VDSColor.elementsPrimaryOndark - } - } () + public var textColorConfiguration = DisabledSurfaceColorConfiguration().with { + $0.disabled.lightColor = VDSColor.elementsSecondaryOnlight + $0.disabled.darkColor = VDSColor.elementsSecondaryOndark + $0.enabled.lightColor = VDSColor.elementsPrimaryOnlight + $0.enabled.darkColor = VDSColor.elementsPrimaryOndark + } //-------------------------------------------------- // MARK: - Initializers @@ -100,7 +98,7 @@ open class LabelBase: UILabel, ModelHandlerable, ViewProt super.init(coder: coder) initialSetup() } - + //-------------------------------------------------- // MARK: - Public Functions //-------------------------------------------------- @@ -127,14 +125,14 @@ open class LabelBase: UILabel, ModelHandlerable, ViewProt accessibilityTraits = .staticText numberOfLines = 0 } - + //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- open func updateView(viewModel: ModelType) { textAlignment = viewModel.textPosition.textAlignment textColor = textColorConfiguration.getColor(viewModel) - + if let vdsFont = viewModel.font { font = vdsFont } else { @@ -200,6 +198,7 @@ open class LabelBase: UILabel, ModelHandlerable, ViewProt $0.maximumLineHeight = lineHeight $0.minimumLineHeight = lineHeight $0.alignment = viewModel.textPosition.textAlignment + $0.lineBreakMode = lineBreakMode } attributedString.addAttribute(.baselineOffset, value: baselineOffset, range: entireRange) attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange) @@ -207,6 +206,7 @@ open class LabelBase: UILabel, ModelHandlerable, ViewProt } else if viewModel.textPosition != .left { let paragraph = NSMutableParagraphStyle().with { $0.alignment = viewModel.textPosition.textAlignment + $0.lineBreakMode = lineBreakMode } attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange) }