Search code examples
macoscocoaswiftnstextfield

Recognize which of NSTextFields is editing now swift


I have to write a program that navigates between multiple NSTextFields (that I store in the array) with keyboard arrows and I need to recognize, which of many NSTextFields user is editing at the moment of test. Is there any way to do that in swift?


Solution

  • You could use NSWindow firstResponder to know which NSTextField is selected at any moment.