osx - Get text from NSTextView in Swift -


I have a NSTextView that will type in users text, I'm using it instead of a NSTextField because I Required if the user enters the hit (this does not work with NSTextField, but it does with NSTextView)

I have come to know of my life that all the text of NSTextView How to get it

The answer then tells me how to do this in Objective:

But I have a hard time coming in Swift if I NSAttributedString attempts to enter the textstoring property, then I get the error "Express type NSTextStorage can not be converted to type NSAttributedString" error

This is an OSX application, not an iPhone application, if for some reason If any difference comes from

help I forgot the exclamation point during the casting. Thanks in advance.

I needed to do this: (NSTextView's name is TxtPhoneNumbers)

  (NSAttributedString as TxtPhoneNumbers.textStorage!). String  

Comments