と のオブザーバーがUIKeyboardWillShowNotification
ありUIKeyboardWillHideNotification
ます。
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
viewController が現在表示されていない場合に機能することを除いて、すべて機能します。
と比較してみましたが、モーダルビューコントローラーの下にあるモーダルビューがself.navigationcontroller.topViewController
表示されている場合、これは機能しません。topViewController