Used this library to handle keyboard actions
I have UITableView which is moving/collapsed/expanded and a bottom bar which moves alongside with a keyboard. When the keyboard is shown user can click outside the text field to hide the keyboard
The problem is UITableView receives didSelectRow events but the touch location is incorrect. Looks like table waits for keyboard dismiss animation and only then handles touches (when cells are already moved).
How to make UITableView receive correct touch location in this case?
Doesn't work:
+delayed
resignFirstResponderto allowUITableViewto handle touches faster than keyboard will be dismissed. Result - some table sometimes ignores touches.Works:
Modify the library code:
UIResponder.currentFirstResponder?.resignFirstResponder()This line starts animation and modifies frames immediately. So you need somehow get touch location and pass it to the view you need before it will be executed. The view can be added by passing inside delegate method (scrollView is used for other purposes and is not suitable for this case) and touches can be simulated like: