2

We are using IQKeyboardManager library for Swift project. Its working fine, but, After clicking the "Done" button its not calling the method.

 override func viewDidLoad() {
        super.viewDidLoad()
        self.myTextField.delegate = self
        self.myTextField.keyboardToolbar.doneBarButton.setTarget(self, action: #selector(doneButtonClicked))
}

 @objc func doneButtonClicked(_ sender: Any) {
        //your code when clicked on done

    }

And the library version is

pod 'IQKeyboardManagerSwift', '6.0.2'

Any suggestions?

2 Answers2

3

This is issue in IQKeyboardManagerSwift version 6.0.2

Fixed issue

You can use UITextFieldDelegate

   func textFieldDidEndEditing(_ textField: UITextField) {

        print("done click ")
 }

or update IQKeyboardManagerSwift 6.0.3

pod 'IQKeyboardManagerSwift', '6.0.3'

a.masri
  • 2,439
  • 1
  • 14
  • 32
0
// Don't set button for keyboardToolbar. Set button direct to textfield.
    self.myTextField.doneBarButton.setTarget(self, action: #selector(self.doneButtonClicked(_:)))
Yagnesh Dobariya
  • 2,241
  • 19
  • 29