I am working in a Swift project where I have several input fields. I made a custom view for each of the input fields because we use them a lot in the project.
I added IQKeyboardManager
to the project. It works really good, and the view gets up according to the active text field.
However, the Next/Previous buttons do not appear. I have tried setting the tags of the text fields in code like this:
slNameField.setTextField("Name", keyboardType: UIKeyboardType.NamePhonePad, image: UIImage(named: "ic_name"))
slNameField.txtField.tag = 101
slEmailField.setTextField("Email", keyboardType: UIKeyboardType.EmailAddress, image: UIImage(named: "ic_email"))
slEmailField.txtField.tag = 102
slLocationField.setTextField("City, Country", keyboardType: nil, image: UIImage(named: "ic_location"))
slLocationField.txtField.tag = 103
Here's some illustrations of the project:
I am also stuck into same problem. As mentioned by @sam there is a very helpful demo project of the library.
Solution You only need to select the UIView in which all the textField or UIViews are. And then you just need to change it's class to
"IQPreviousNextView"
And all of the rest will be handled by the library.
Problem screen image
And solution is screen short
Hope it help :). it saved my day.
@Ibrahim Yildirim, If next and previous buttons are not appearing on toolbar this is because textfields must not be in same uiview. they will only appear if all textfields are in same super view .
Please add the line of code in your app delegate file (AppDelegate.swift) in this function: didFinishLaunchingWithOptions. The line of code: IQKeyboardManager.shared.previousNextDisplayMode = .alwaysShow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With