NSTextField transparent background

The secret is setting ALL THREE of these properties on the NSTextField...

myTextField.bezeled         = NO;
myTextField.editable        = NO;
myTextField.drawsBackground = NO;

There is a property in the .xib file, on the interface builder window for the text field, under attribute inspector

  1. Check the Display Draws Background
  2. Select a background color. Select clear color for transparent background.

enter image description here


As of 10.12 you can just do:

let label = NSTextField(labelWithString: "HELLO")