fixed bug for the Label
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
10fdd6bcb8
commit
413d5567af
@ -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?) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user