diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 60e88740..db9804d0 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -133,10 +133,12 @@ open class Label: UILabel, ViewProtocol, UserInfoable { open override var lineBreakMode: NSLineBreakMode { didSet { setNeedsUpdate() }} /// Text that will be used in the label. + private var _text: String! override open var text: String! { - get { super.text } + get { _text } set { textSetMode = .text + _text = newValue styleText(newValue) } } @@ -278,7 +280,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable { //-------------------------------------------------- private func restyleText() { if textSetMode == .text { - styleText(text) + styleText(_text) } else { styleAttributedText(attributedText) } @@ -304,10 +306,9 @@ open class Label: UILabel, ViewProtocol, UserInfoable { lineBreakMode: lineBreakMode) applyAttributes(mutableText) - + // Set attributed text to match typography super.attributedText = mutableText - } private func styleAttributedText(_ newValue: NSAttributedString?) {