Reputation: 41
I want to present emoji panel and using NSApp.orderFrontCharacterPalette(nil)
. it works fine, but sometimes it appears at random place and i want it to be "constrained" to text field where I'm going to use it. Can i set frame of panel manually or do it in another way? thanks for help
Upvotes: 4
Views: 350
Reputation: 799
It requires your text field to be the first responder.
You could make a text field the first responder by calling following method:
Swift:
textField.window?.makeFirstResponder(textField)
Objective-C:
[[textField window] makeFirstResponder:textField];
Hope it helps.
Upvotes: 1