How to check NSTextField is first responder

Issue #961

NSTextField uses NSFieldEditor under the hood, you can check currentEditor if it is the firstResponder

extension NSTextField {
    var isFirstResponder: Bool {
        currentEditor() == window?.firstResponder
    }
}
Written by

I’m open source contributor, writer, speaker and product maker.

Start the conversation