I have a storyboard, which includes navigation between views. Back and forth, and there is also the possibility to jump all the way to the home screen.
Basically, it works like this:
The keyboard and everything works perfectly the first time, when the user moves from view 1 to view 2. However, when moving either back from view 3 to view 2, or from view 3 and starting all over again, the keyboard does not show.
In the code, I have becomeFirstResponder in the viewDidAppear method. Also, it will resignFirstResponder when loading view 3. Another interesting fact is that when calling the becomeFirstResponder for the second time, it does return NO (while it returns YES the first time). Also, when returning back to this view the textfields are not possible to select, even though they are userInteractionEnabled.
I am really stuck here, so any help is highly appreciated. I have seen several similar questions to this one, but not found a solution:
I was able to track down the problem in my code. Answering this question myself since it might be helpful to others as well.
My issue was that I didn’t really get the order of events correct. I had a button that would move to the next textfield, and if everything was completed it would move to the next screen. This caused the becomeFirstResponder method to be called and not released (resignFirstResponder) when switching to a new screen.
I guess the main advice I can give (at least what finally worked for me), was to just go through all the becomeFirstResponder and make sure it is released before moving to next screen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With