How to override attribute string in Swift

Issue #732

Use NSMutableAttributedString and add attribute for whole range

1
2
3
4
let a: NSAttributedString
let m: NSMutableAttributedString = NSMutableAttributedString(attributedString: a)
let range = NSRange(location: 0, length: a.length)
m.addAttribute(.backgroundColor, value: NSColor.clear, range: range)

Comments