0

Many of my views implement methods for a notification for UIKeyboardWillShowNotification

they move around internal views to move out of the way of the keyboard.

Problem I have is that I don't know which view triggered the notification.

How can I tell?

Avba
  • 14,822
  • 20
  • 92
  • 192

1 Answers1

0

There is no sender attached to the NSNotification object, if that's what you meant. You can use the UITextViewDelegate and UITextViewDelegate to store the sender globally, since the KeyboardWillShow notification is sent after the view becomes the responder(when editing begins, actually).

- (void)textFieldDidBeginEditing:(UITextField *)textField{
        self.senderView= textField;
        // ...
}
Mercurial
  • 2,095
  • 4
  • 19
  • 33