How do I restore the style after UITextView, is inserted into attributeString?

problem description

after textView append an attributeString with the code, continue to edit the keyboard, the style cannot be restored

related codes

The code for

button is as follows:

let attributeText = NSMutableAttributedString(attributedString: textView.attributedText)
attributeText.append(NSAttributedString(string: "@", attributes: [NSAttributedString.Key.foregroundColor: UIColor.cyan]))
self.textView.attributedText = attributeText

what result do you expect? What is the error message actually seen?

I want textView to revert to its original style when it is re-edited


has found the answer. You can set the typingAttributes of textView in shouldChangeTextIn to reset to the previous style

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b48b-2afc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b48b-2afc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?