how to change characters case to Upper in NSAttributedString
I want to convert NSAttributedString containing RTFD to uppercase without losing attributes of existing characters and graphics. Thanks, EDIT: @fluidsonic Is correct that the original code is incorrect. Below is an updated version in Swift, that replaces the text in each attribute range with an uppercased version of the string in that range. extension NSAttributedString { func uppercased() -> NSAttributedString { let result = NSMutableAttributedString(attributedString: self) result.enumerateAttributes(in: NSRange(location: 0, length: length), options: []) {_, range, _ in result