This is very difficult to do, as Apple makes it very difficult. I achieved this by subclassing NSTextFieldCell and ovrriding the drawRectForBounds method: for example:
override func drawingRectForBounds(theRect: NSRect) -> NSRect { let newRect = NSRect(x: 0, y: (theRect.size.height - 22) / 2, width: theRect.size.width, height: 22) return super.drawingRectForBounds(newRect) }
This is just my way of doing this, I'm sure there are better ways that I don't know yet. And this only works for the standard font size in TextFields (which gives the height of the text is 22). This is why I hard-coded this. They haven't figured out how to get the height in the cell if you change the font.
Result:

source share