Reputation: 13079
How can i get a notification if a NSView gets the key focus?
I expected a method like "windowDidBecomeKey" from NSWindow but either i'm blind or there is nothing like this is NSView.
Upvotes: 4
Views: 4621
Reputation: 96353
The key view, when there is one, is the first responder. So, implement the becomeFirstResponder
method in your view, and either handle that there or post a notification for your controller to listen for.
Upvotes: 7