1

I have an UIView that has several UITextFields inside. I have registered selector for UIKeyboardDidShowNotification. When I touch the field, the selector gets called and the keyboard is shown. If i than tap to next field selector is not called, which is what should happen.

Now if i do everything again, but attach simple inputAccessoryView to field, something different happens. Whenever I touch the field selector is called, although keyboard is already shown.

Is this a bug by apple, or am I missing something?

MegaManX
  • 8,766
  • 12
  • 51
  • 83

1 Answers1

1

Been hitting a similar problem, seems that it is "normal" the extra notification is because of the "inputView" (as you already inferred). The first notification contains the original size of the keyboard while the second contains the size of the keyboard plus the size of the input view in the UIKeyboardFrameBeginUserInfoKey part of the notification. My guess is that as the size of what it considers a keyboard "changes" delivers a new notification saying "hey the size has changed". Weird? yes, but it is the expected behaviour as far as I can tell.

So if you want to react to only one you have to filter by that frame value...

See: dgangsta answer here: (confirms my guess) can't get correct value of keyboard height in iOS8

PakitoV
  • 2,476
  • 25
  • 34