Reputation: 11175
I have been trying to implement some code to move the screen up when the user taps a text field so that it is not covered up by the keyboard. I know there are tons of Objective-C examples but I can't find any Swift versions. Also, what is the best way to implement this so that it works on both the 4 inch devices as well as the 3.5 inch devices?
Upvotes: 1
Views: 1634
Reputation: 3067
I use this handy solution called TPKeyboardAvoiding in one of my apps: https://github.com/michaeltyson/TPKeyboardAvoiding
It's in Objective-C but it works great. It's constantly updated also (last update 4 days ago). I'm sure it will be updated once iOS 8 goes public.
This does work perfectly on any device whether its 3.5 inches, 4 inches or an iPad.
Upvotes: 2