fix for setting text issue

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-09-12 14:04:05 -05:00
parent ce8e2fb535
commit e52ae195f3

View File

@ -129,14 +129,20 @@ 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 {
get { _text }
set {
if _text != newValue {
_text = newValue
useAttributedText = false
attributes = nil
setNeedsUpdate()
}
}
}
/// Whether the View is enabled or not.
open override var isEnabled: Bool { didSet { 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