diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index d242c2e6..76dceb19 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -129,12 +129,18 @@ open class Label: UILabel, ViewProtocol, UserInfoable { /// Line break mode for the label, default is set to word wrapping. open override var lineBreakMode: NSLineBreakMode { didSet { setNeedsUpdate() }} + private var _text: String? + /// Text that will be used in the label. override open var text: String? { - didSet { - useAttributedText = false - attributes = nil - setNeedsUpdate() + get { _text } + set { + if _text != newValue { + _text = newValue + useAttributedText = false + attributes = nil + setNeedsUpdate() + } } } @@ -194,7 +200,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable { open func updateView() { if !useAttributedText { - if let text = text { + if let text { accessibilityCustomActions = [] //create the primary string