I want to change a contents of NSMutableAttributedString
object which was already appended to anonter NSMutableAttributedString
(which is displayed in UITextView
).
The following code did not updating text on the screen:
var my_text = NSMutableAttributedString.init(string: "")
my_text_view.attributedText = my_text
let ats = NSMutableAttributedString.init(string: ":"+sml+":", attributes: [.font:UIFont.systemFont(ofSize: 16),.foregroundColor:UIColor.gray])
my_text.append(ats)
my_text_view.attributedText = my_text // this refreshes all attachments
...
ats.mutableString.setString("") // The text on the screen did not changed
my_text_view.attributedText = my_text // Still no changes
All of the image attachments are updating, so this is not an UITextView issue.
So, how to update a text in NSMutableAttributedString
?