'Integrated Form Doesn't Move When Text Fields Are Selected

I have embedded a ScrollView within a UIViewController which contains multiple text fields that will act as a simple form to collect user data (Name, email, etc.). The problem is that when a text field is selected and the keyboard slides up, the text field is obscured by the keyboard. How can I slide the text fields back into view so that the user can clearly see what they are using as input?



Solution 1:[1]

You have to check for uikeyboard visibility ( see this post How can I programmatically check whether a keyboard is present in iOS app? ) and then call scrollRectToVisible for the selected textField. If you google about uikeyboard and scrollRectToVisible you will find many tutorial about this problem...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman