removed code and call the code that does the same thing under the hood.

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-03-08 14:20:44 -06:00
parent dcb5b91e32
commit b638637af7

View File

@ -182,29 +182,7 @@ public typealias ActionBlock = () -> ()
} }
@objc public func resetAttributeStyle() { @objc public func resetAttributeStyle() {
/* setNeedsUpdate()
* This is to address a reuse issue with iOS 13 and up.
* Even if you set text & attributedText to nil, the moment you set text with a value,
* attributedText will hold a dirty value from a previously reused cell even if reset() is
* appropriately called.
* Only other reference found of issue: https://www.thetopsites.net/article/58142205.shtml
*/
if let text = text, !text.isEmpty {
//create the primary string
let mutableText = NSMutableAttributedString.mutableText(for: text,
textStyle: textStyle,
useScaledFont: useScaledFont,
textColor: textColorConfiguration.getColor(self),
alignment: textAlignment,
lineBreakMode: lineBreakMode)
if let attributes = attributes {
mutableText.apply(attributes: attributes)
}
self.attributedText = mutableText
}
} }
public func viewModelDidUpdate() { public func viewModelDidUpdate() {