I am having multiple textfields and I won't to invoke an action method if the user clicks on a textfield, this is what I currently have:
override func mouseDown(theEvent: NSEvent) {
}
for the click event.
This is the action to which it should reference when a textfield is pressed:
func myAction(sender: NSView)
{
print("aktuell: \(sender)")
currentObject = sender
}
For buttons it is working with the action and selector but this does not work for textfields...
button.action = #selector(myAction)
Please give examples only in swift, I know that there are plenty of examples in obj.-c. Thanks!