fixed bug for the Label

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-03-13 10:41:06 -05:00
parent 10fdd6bcb8
commit 413d5567af

View File

@ -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?) {