Merge branch 'bugfix/CXTDT_344190_attribute_issue' into 'develop'

fix for CXTDT_344190

### Summary
When multiple underline loading on the table cell, we see this issue, it is happening when cell reuse case. the fix which we given its from this link: https://stackoverflow.com/questions/58628067/cant-reset-uilabel-attributedtext-when-a-uitableviewcell-is-reused

### JIRA Ticket
https://onejira.verizon.com/browse/CXTDT-344190

Co-authored-by: Nandhini Rajendran <nandhini.rajendran@verizon.com>
Co-authored-by: Murugan, Vimal <vimal.murugan@one.verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/909
This commit is contained in:
Pfeil, Scott Robert 2022-12-12 13:58:28 +00:00
commit 2c3ae47bd3

View File

@ -241,18 +241,7 @@ public typealias ActionBlock = () -> ()
case left
}
public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject? = nil, _ additionalData: [AnyHashable: Any]? = nil) {
clauses = []
text = nil
attributedText = nil
originalAttributedString = nil
shouldMaskWhileRecording = model.shouldMaskRecordedView ?? false
guard let labelModel = model as? LabelModel else { return }
text = labelModel.text
@objc public func resetAttributeStyle() {
/*
* 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,
@ -274,6 +263,21 @@ public typealias ActionBlock = () -> ()
self.attributedText = attributedString
}
}
public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject? = nil, _ additionalData: [AnyHashable: Any]? = nil) {
clauses = []
text = nil
attributedText = nil
originalAttributedString = nil
shouldMaskWhileRecording = model.shouldMaskRecordedView ?? false
guard let labelModel = model as? LabelModel else { return }
text = labelModel.text
resetAttributeStyle()
hero = labelModel.hero
Label.setLabel(self, withHTML: labelModel.html)