Search code examples
iosobjective-ciphoneiqkeyboardmanager

IQKeyboard Manager not enabling in static tableview?


I have trying to create an app in objective c in which I placed textfield and textview in static tableview cell and used a third party library for both textview and textfield in each cell.

Later I tried to implement the library IQKeyboardManager but failed.This is my viewdidLoad() code.

- (void)viewDidLoad {
[super viewDidLoad];
[[IQKeyboardManager sharedManager] setToolbarManageBehaviour:IQAutoToolbarByPosition];
}

I tried to do the same in viewDidAppear but it didn't help. All the required files were imported too but for some reason auto positioning is not working. Do anyone know why? Alternate solution also welcome.Thanks in advance.


Solution

  • Add the this code

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

    Also, add following code to your view controller

    -(void)viewWillAppear:(BOOL)animated{
    
       [super viewWillAppear:YES];
    }