Reputation: 3755
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?
Upvotes: 2
Views: 5538
Reputation: 2251
// Don't set button for keyboardToolbar. Set button direct to textfield.
self.myTextField.doneBarButton.setTarget(self, action: #selector(self.doneButtonClicked(_:)))
Upvotes: 0
Reputation: 2469
This is issue in IQKeyboardManagerSwift
version 6.0.2
You can use UITextFieldDelegate
func textFieldDidEndEditing(_ textField: UITextField) {
print("done click ")
}
or update IQKeyboardManagerSwift 6.0.3
pod 'IQKeyboardManagerSwift', '6.0.3'
Upvotes: 3