1

I'm presenting a VC, which is in a navigation controller. If I have the keyboard open and dismiss it, the prior VC still shows the keyboard.

I've tried all suggestions I can find searching, namely: How do I dismiss the iOS keyboard? No longer able to hide keyboard during viewWillDisappear in iOS7 Dismiss Keyboard presented in modal View Controller (Form sheet)

I've tried adding the "endediting" in viewWillDisappear, also resignFirstResponder on both the search bar AND VC... No luck with any of these..

Community
  • 1
  • 1
JDM
  • 883
  • 1
  • 8
  • 20
  • 2
    Have you tried not calling `resignFirstResponder` in `viewWillDisappear`, but instead in the button / cell callback that will cause it to move to the next screen – Simon McLoughlin Oct 20 '14 at 16:10
  • simon is right, make use of resignFirstResponder – ZAZ Oct 20 '14 at 16:13
  • Thanks. Turns out the test case had the issue only happening when the search bar opened the keyboard and then another text field was tapped.. The issue was we have a custom picker but the text field was keeping the keyboard open. I found this and it helped fix my issue: http://stackoverflow.com/questions/15135784/how-to-disable-keyboard-appearing-when-hitting-on-a-text-field-ios – JDM Oct 20 '14 at 16:34
  • Thanks Simon! I had the same problem because I was calling resignFirstResponder in viewWillDisappear, instead I called resignFirstResponder from the callback method for switching VCs and it solved the problem – MSU_Bulldog Dec 05 '14 at 19:07

0 Answers0