If you are an iOS developer very likely you faced this problem: when a user clicks on some field to type, the keyboard pops up and covers the text field.
Recently I had this problem as well, looking for a solution I found this link from Apple's iOS Developer Library.
Despite the good source, I didn't like having to place my views (like
UITextField) inside a
UIScrollView to solve this matter.
Another Approach To Solve
I found a simpler way, did some changes and then wrapped it in a
There is no secret here. We observe
UIKeyboardWillHideNotification calling its respective bound methods when the events are fired.
The handler methods then scroll up/down the parent view according to keyboard's height.
In the controllers you need this solution, just subclass
At last, don't forget to bind
Editing Did Begin and
Editing Did End to
textFieldEditingDidEnd respectively for each
UITextField you need to fix.
That's all. See you.