I am having a hard time controlling keyboard behavior when I push a UIViewController
using pushViewController:animated:
The from view contains some UITextField
s but the to view has none. If the keyboard is present at the time of the push, it self-resigns automatically alongside the horizontal push animation. It's a little jarring to see the from view slide down at the same time as the to view slides in.
Can I have the keyboard maintain its position and slide horizontally out of view with the from controller? I've certainly seen this done the other way round, where the to controller has a presented keyboard sliding in from the left when pushed.
I, too, am not sure this is possible. Basically you have to add the keyboard as a subview of the current view in prepareForSegue
. I don't know if you can do that with the keyboard.
If not, you can sorta cheat by doing the following in prepareForSegue
:
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