You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To run the example project, clone the repo, and run pod install from the Example directory first.
Requirements
Installation
IQKeyboardReturnManager is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod'IQKeyboardReturnManager'
Usage
To handle keyboard return key automatically:-
import IQKeyboardReturnManager
classViewController:UIViewController{letreturnManager:IQKeyboardReturnManager=.init()overridefunc viewDidLoad(){
super.viewDidLoad()
// This will add all textInputView of the controller and start observing for textFieldShouldReturn events
returnManager.addResponderSubviews(of:self.view, recursive:true)
// If you would like to dismiss the UITextView on tapping on return then add this
returnManager.dismissTextViewOnReturn =true
// If you would like to change last textInputView return key type to done or something else, then add this
returnManager.lastTextInputViewReturnKeyType =.done
// If you would like to customize the navigation between textField by your own order then add them manually
returnManager.add(textInputView: textField1)
returnManager.add(textInputView: textField2)
returnManager.add(textInputView: textField3)
returnManager.add(textInputView: textField4)}}
// IQKeyboardReturnManager will forward all delegate callbacks to you, so you can customize the decisions
extensionViewController:UITextFieldDelegate{@objcpublicfunc textFieldShouldBeginEditing(_ textField:UITextField)->Bool{...}}