I created NSTextfield programmatically:
func createText(point:NSPoint) {
let txtFld = AnnotationTextField(frame: NSMakeRect(point.x, point.y, 360,40))
txtFld.isEnabled = true
txtFld.delegate = self
self.contentView.addSubview(txtFld)
txtFields.append(txtFld)
txtFld.becomeFirstResponder()
}
But when I click on another field or hit Enter key, my string not saving.

becomeFirstResponder: "Use the NSWindow makeFirstResponder(_:) method, not this method, to make an object the first responder. Never invoke this method directly.". - WillekeAnnotationTextField? Where does "Enter your text here" come from? What happens when you use aNSTextfield? - Willeke