Interface Builder should allow setting typingAttributes for an initially-empty NSTextView

Originator:jediknil
Number:rdar://FB7591381 Date Originated:2020-02-20
Status:Open Resolved:
Product:Xcode Product Version:11.3.1 (11C504)
Classification:Suggestion Reproducible:
 
I have an NSTextView whose contents are populated programmatically. I do this by setting the NSTextView’s ‘string’ property, and letting it pick up its attributes from the ‘typingAttributes’ property. However, there’s no way to configure that from Interface Builder, leaving me to put in some dummy text and then do this workaround:

	output.typingAttributes = output.textStorage!.attributes(at: 0, effectiveRange: nil)
	output.string = ""

At least for a non-rich-text-supporting and/or non-editable NSTextView, configuring the font of an empty instance should result in setting the typing attributes, rather than simply being ignored as it is today.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!