4

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;
}
Nikita Patil
  • 674
  • 1
  • 7
  • 17

4 Answers4

4

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;
}
Nikhil Manapure
  • 3,748
  • 2
  • 30
  • 55
Khawar Islam
  • 2,556
  • 2
  • 34
  • 56
2

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

Reinier Melian
  • 20,519
  • 3
  • 38
  • 55
1

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?

0

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

[[IQKeyboardManager sharedManager] setEnable:YES];
tailor
  • 680
  • 4
  • 12