I have implemented custom attributes for an AttributedString and successfully converted to NSAttributedString and used in NSTextView with custom coloring and background, works nicely!
What does not work is encoding the AttributedString to JSON. The custom attributes are not coded. I use a plain JSON encode like this:
let data = JSONEncoder().encode(object)
I assume some option is needed for the encoder to deal with the custom attributes (like when converting to NSAttributedString), but I have not been able to find any documentation on how to do this. Any suggestions?
1
0
2.5k