Jessica thompson
Jessica thompson

Reputation: 407

IQKeyboardManager not working properly in my view controller

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

Upvotes: 2

Views: 6109

Answers (2)

Mohsen Fard
Mohsen Fard

Reputation: 598

Add the following lines to the AppDelegate

IQKeyboardManager.sharedManager().enable = true
IQKeyboardManager.sharedManager().keyboardDistanceFromTextField = 100

Upvotes: 1

Matias Jurfest
Matias Jurfest

Reputation: 1389

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

Upvotes: 5

Related Questions