Software engineering, open source, community and passion
Content Locked Under Keyboard: Another Approach To Solve
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.
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 UIViewController:
There is no secret here. We observe UIKeyboardWillShowNotification and 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 UncoveredContentViewController:
At last, don't forget to bind Editing Did Begin and Editing Did End to textFieldEditingDidBegin and textFieldEditingDidEnd respectively for each UITextField you need to fix.