2

Currently I have an UI designed that consists of two simple text fields for resetting password. In my viewm, I haven't used the UIScrollView. So when the UI displays on an iPhone SE, the UI should move up as the UITextField gets hidden behind the keyboard. To avoid this, I am using a famous library:

https://github.com/hackiftekhar/IQKeyboardManager

But still when my UI comes it is not moving up.

UITextField is still hidden under keyboard

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
Jessica thompson
  • 407
  • 2
  • 8
  • 20
  • 2
    In my case, it wasn't working because I was using a UIScrollView. When I removed it, it worked just fine. Just commenting to let anybody that's having the same problem that I did know that. – Rod Mar 16 '18 at 19:12
  • @Rod Any solution for working with scrollview? – Asad Khan May 17 '19 at 15:51

2 Answers2

4

You need to add the following line to the AppDelegate (to enable in all the view controllers) or just in the viewDidLoad of the UIViewController you want to enable the IQKeyboardManager.

IQKeyboardManager.sharedManager().enable = true
Matias Jurfest
  • 1,378
  • 16
  • 25
1

Add the following lines to the AppDelegate

IQKeyboardManager.sharedManager().enable = true
IQKeyboardManager.sharedManager().keyboardDistanceFromTextField = 100
Mohsen Fard
  • 597
  • 9
  • 22