Removing all attributes
suggest changeObjective-C
NSMutableAttributedString *mutAttString = @"string goes here";
NSRange range = NSMakeRange(0, mutAttString.length);
[mutAttString setAttributes:@{} range:originalRange];
As per Apple Documentation we use, setAttributes
and not addAttribute
.
Swift
mutAttString.setAttributes([:], range: NSRange(0..<string.length))
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents