Brandon Bradley Brandon Bradley - 21 days ago 7x
Swift Question

What Are The Accepted Keys for NSTextView.typingAttributes?

In Swift on macOS, I have the following Text View and want to set the font size of text that is entered into it, like so:

myTextView.typingAttributes = ["Unknown" : NSFont(name: "Helvetica", size: 18)]

I am currently unable to do this, as I do not know, nor could a find on the
Apple Documentation Page, what the accepted keys are for typingAttributes.

Does anyone know what these are, or where to find them?


You can find the supported attribute names in the documentation for NSAttributedString under Character Attributes. For the font, you would use NSFontAttributeName.