title: Why does a NSTextField's field editor inherit the text color of it's target field when it's configured otherwise?
body: <p>My <code>NSTextField</code>'s <code>textColor</code> is <code>white</code> and non-editable. When I click on the label, I set the <code>NSTextField</code> to <code>isEditable = true</code>. Performing a second click on the label places it into edit mode. I get a field editor etc.</p>
  
  <p>Prior or editing it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Orrjt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Orrjt.png" alt="step_1"></a></p>
  
  <p>I am subclassing my <code>NSTextField</code> to configure that field editor like so:</p>
  
  <pre><code>override func becomeFirstResponder() -&gt; Bool {
      let value = super.becomeFirstResponder()
  
      if value == false {
          return value
      }
  
      if let fieldEditor = currentEditor() as? NSTextView {
  
          fieldEditor.backgroundColor = NSColor.white
          fieldEditor.drawsBackground = true
          fieldEditor.textColor = NSColor.black
      }
  
  
      return value
  }
  </code></pre>
  
  <p>You can see from the code above I am setting the <code>textColor</code> of the field editor to <code>black</code>. When I enter editing mode I get the expected behavior:</p>
  
  <p><a href="https://i.stack.imgur.com/i606m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i606m.png" alt="step_2"></a></p>
  
  <p>So far so good. Enter the issue: Any new keystrokes are reflected as <code>white</code> text:</p>
  
  <p>In the sample below I have highlighted the contents of the field to show the white text:</p>
  
  <p><a href="https://i.stack.imgur.com/xSkFp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xSkFp.png" alt="step_3"></a></p>
  
  <p>So it would seem that even though I am setting the <code>fieldEditor.textColor = NSColor.black</code> and I see that black color, the field editor is inheriting the <code>NSTextField</code>'s text color for new input?</p>
  
  <p>If, in my editor configuration I do this, keep in mind this is in a NSTextField subclass:</p>
  
  <pre><code>fieldEditor.backgroundColor = NSColor.white
  fieldEditor.drawsBackground = true
  fieldEditor.textColor = NSColor.black
  textColor = NSColor.black // &lt;-------     
  </code></pre>
  
  <p>Then text input while in editing mode does come though as black. I understand the field editor is a proxy to the <code>NSTextField</code>:</p>
  
  <p><a href="https://developer.apple.com/library/content/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextEditing/TextEditing.html#//apple_ref/doc/uid/TP40009459-CH3-SW29" rel="nofollow noreferrer">https://developer.apple.com/library/content/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextEditing/TextEditing.html#//apple_ref/doc/uid/TP40009459-CH3-SW29</a></p>
  
  <p>So is the flow:</p>
  
  <ul>
  <li>field editor shows</li>
  <li>becomes first responder</li>
  <li>has some kind of view for the first render</li>
  <li>sends keystrokes to the underlying <code>NSTextField</code></li>
  <li>updates itself using the <code>NSTextField</code> settings?</li>
  </ul>