This is the default view without the keyboard
This is what happens when the keyboard shows up
I am using the IQKeyboardManagerSwift and would like to reduce the distance between the keyboard and the textfield. I have already tried changing keyboardDistanceFromTextField, but it didn’t change anything, like this:
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.keyboardDistanceFromTextField = 10
And yes, the keyboard manager should be working because I already use it’s other functions like the IQKeyboardManager.shared.enableAutoToolbar = false
I fixed the problem by checking if the TextField is active with
func textFieldDidBeginEditing(_ textField: UITextField) {
heightConstraint.constant = 25
heightConstraint2.constant = 10
buttonHeightConstraint.constant = 11
}
And if the TextField is active - it changes the constraints that I declared as Outlets. When the TextField isn't active, it changes the constraints back to the previous values:
func textFieldDidEndEditing(_ textField: UITextField) {
heightConstraint.constant = 60
heightConstraint2.constant = 20
buttonHeightConstraint.constant = 20
}