Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextVIew is not moving up while typing

I installed a pod file IQKeyboardManager in my project, but it is not working.

Here is screenshot, enter image description here

Image 1: This is my one of view for creating a ticket.

Subject and Message are text view, not text field.

When I start typing in Subject (subjectTextView) then I am not able to see what I'm typing & the same thing is happening in the message (messageTextView). I am not able to see content what I am typing in textview (see Image 2 A)

When I click on done then we can able see content (see image 2 B)

is there any solution? When I start typing in subjectTextView and messageTextview I want to move textview up while typing.

Update : I added following code in appdelegate file, still not working

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [[IQKeyboardManager sharedManager] setEnable:YES];

    return YES;
}
like image 205
Nikita Patil Avatar asked Mar 07 '23 04:03

Nikita Patil


1 Answers

You have to enable IQKeyboardManager. You can enable it in app delegate's didFinishLaunchingWithOptions method.

Swift 4 Xcode 9

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    IQKeyboardManager.sharedManager().enable = true
    return true
}

Objective C

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[IQKeyboardManager sharedManager] setEnable:YES];
    return YES;
}
like image 68
Khawar Islam Avatar answered Mar 16 '23 13:03

Khawar Islam