Is there a NSNotification for objects that become first resoponder?
-
12-10-2019 - |
Question
Is there a NSNotification for objects that become first responder. Like NSNotification that give me the UITextfield that cause the keyboard to pop up?
Solution
Check UITextFieldTextDidBeginEditingNotification
, the textField that started editing is in notification's object
property.
There're also UIKeyboardWillShowNotification
and UIKeyboardDidShowNotification
notifications
OTHER TIPS
Another option is to have your view controller be a delegate to the UITextField. UITextFieldDelegate has a textFieldDidBeginEditing: method.
No, But you could check it manually by using "IsFirstResponder" (BOOL).. Can you explain a little bit more what you want to accomplish? Maybe there is a way to use another notification.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow