Nikita Patil
Nikita Patil

Reputation: 724

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;
}

Upvotes: 4

Views: 706

Answers (4)

Mallikarjun Hanagandi
Mallikarjun Hanagandi

Reputation: 510

Add below code in App Delegate didFinishLaunchingWithOptions method,'

[[IQKeyboardManager sharedManager] setEnable:YES];

or You can add in viewWillDisappear or viewDidLoad method in that class.

You may be done one small mistake. Have you written anything in viewWillAppear or viewWillDisappear method?

Upvotes: 1

Reinier Melian
Reinier Melian

Reputation: 20804

You need enable the IQKeyboardManager in your AppDelegate didFinishLaunchingWithOptions method using

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

    return YES;
}

should work

Upvotes: 2

tailor
tailor

Reputation: 665

try by adding below line in your Create Ticket Controller's viewWillAppear to re-enable

[[IQKeyboardManager sharedManager] setEnable:YES];

Upvotes: 0

Khawar Islam
Khawar Islam

Reputation: 2914

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;
}

Upvotes: 4

Related Questions