IQKeyboardManager not disabling

时光怂恿深爱的人放手 提交于 2019-12-05 22:25:21

Disable IQKeyboard Manager In Objective C

If you want to disable IQKeyboardManager in particular controller of your project. Then add this line in your viewController Class.

 #import "IQKeyboardManager.h"

Now In View Controller viewDidLoad Methods, add the below function

[[IQKeyboardManager sharedManager] setEnableAutoToolbar:false];

Now when you leave the controller, so that your IQKeyboardManager will enable when you leave that viewController**.

In **viewWillDisappear** Method:-

[[IQKeyboardManager sharedManager] setEnableAutoToolbar:true];

Disable IQKeyboard Manager In Swift 3.0

import IQKeyboardManagerSwift

 override func viewDidLoad() {
    super.viewDidLoad()
    IQKeyboardManager.sharedManager().enableAutoToolbar = false
    IQKeyboardManager.sharedManager().enable = false
}

 //MARK:- viewWillDisappear
 override func viewWillDisappear(_ animated: Bool) {
    IQKeyboardManager.sharedManager().enableAutoToolbar = true
    IQKeyboardManager.sharedManager().enable = true
}

Disable IQKeyboard Manager In Swift 4.2

import IQKeyboardManagerSwift

 override func viewDidLoad() {
    super.viewDidLoad()
    IQKeyboardManager.shared.enableAutoToolbar = false
    IQKeyboardManager.shared.enable = false
}

 //MARK:- viewWillDisappear
 override func viewWillDisappear(_ animated: Bool) {
    IQKeyboardManager.shared.enableAutoToolbar = true
    IQKeyboardManager.shared.enable = true
}

Try This

Just Put below line in Your ViewController viewDidLoad.

[[IQKeyboardManager sharedManager] setEnable:false];

Put Below line in Your ViewController viewWillDisappear;

[[IQKeyboardManager sharedManager] setEnable:true];

The issue was in 'Class implemented in both', because library was included to main app and framework. So I guess I was setting library preferences to one copy, but library was reading preferences from another copy and mine was ignored.

Try this

[[IQKeyboardManager sharedManager] setEnable:NO];
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO];
[[IQKeyboardManager sharedManager] setShouldResignOnTouchOutside:NO];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!