fixed bug where someone could nil out attributedText and resetting the text with the same value wouldn't trigger setNeedsUpdate()

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-02-15 15:38:25 -06:00
parent 39638e77bb
commit fb623627bf

View File

@ -135,15 +135,15 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
override open var text: String? {
get { _text }
set {
if _text != newValue {
if _text != newValue || newValue != attributedText?.string {
_text = newValue
useAttributedText = false
attributes = nil
attributes?.removeAll()
setNeedsUpdate()
}
}
}
/// Whether the View is enabled or not.
open override var isEnabled: Bool { didSet { setNeedsUpdate() } }