title: How to implement secure text with NSTextView?
body: <p><strong>Requirements</strong><br>
  I want to implement the option to hide password input in a custom <code>NSTextView</code>. String data should be set to the underlying model - though it should not be displayed in the view. Instead bullets or nothing at all should be displayed. There should also be the option to show the password.</p>
  
  <p><strong>Experiments</strong><br>
  Therefore, I am searching for a delegate method that notifies me when text has been entered. The closest method I found by now is the following.</p>
  
  <pre><code>textViewDidChangeSelection: // NSTextViewDelegate
  </code></pre>
  
  <p>I tried the following methods to alter the text of the <code>textStorage</code> - without success.</p>
  
  <pre><code>shouldChangeTextInRange:replacementString: // NSTextView
  replaceCharactersInRange:withString: // NSTextStorage
  setAttributedString: // NSTextStorage
  setString: // NSText
  </code></pre>
  
  <p><strong>Questions</strong>  </p>
  
  <ol>
  <li>What delegate method would be suitable?</li>
  <li>How can I substitute the displayed text without changing the model data?</li>
  </ol>
  
  <p><strong>Disclaimer</strong><br>
  I am developing an application with a dark user interface. So, I need to change back- and foreground colors. There are annoying problems like coloring the text cursor that cannot be done with an <code>NSTextField</code>. That's why I want to implement the secure text field with an <code>NSTextView</code>.</p>