I'm using Swift 4 on macOS. I know that I can set the becomeFirstResponder() to a TextField like this:
mytextfield.becomeFirstResponder()
But how can I check if mytextfield is FirstResponder?
I'm using Swift 4 on macOS. I know that I can set the becomeFirstResponder() to a TextField like this:
mytextfield.becomeFirstResponder()
But how can I check if mytextfield is FirstResponder?
Your assumption is wrong about
-becomeFirstResponder
. From the documentation:You make something first responder through
NSWindow
's-makeFirstResponder:
.To answer your question, the property is on
NSWindow
as well calledfirstResponder
.