How to hide only keyboard not inputAccessoryView in Swift

Viewed 96

I have a textField at the bottom of screen. So I use inputAccessoryView with text field. Everything is correctly working, but when i hiding keyboard my inputAccessoryView is also hiding. I don't want to hide my inputAccessoryView (the textField at bottom):

textfields.inputAccessoryView = backgroundViews

For hiding textField:

func textFieldShouldReturn(_ textField: UITextField) -> Bool {
    
    textField.resignFirstResponder()
    return true
}

enter image description here

After using inputAccessoryView view included with textfield comes on top of the keyboard, but when I click on the return button to hide the keyboard. It hides both keyboard and view both. I want to hide only keyboard not the view.The view should be fixed to previous position.

Anyone can help me?

0 Answers
Related