Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pull up keyboard while scrolling UITableView and scroll along with the tableView

To add panning behaviour to the keyboard, I am using DAKeyboardControl. It works just fine (after modifications) for panning behaviour to close the keyboard.

How do I make the keyboard appear if the user tries to scroll downwards (finger pan in up direction) at the end of the UITableView. To be more specific, I am looking for behaviour similar to the Facebook Messages app, where, if you scroll up the keyboard appears, with panning, and scrolls with the table.

EDIT: It seems I am not clear about what I want. I wish to move the keyboard along with the scrollview (UITableView). In the following image, I am panning the keyboard along with the table. The table is already scrolled to it's bottom, and if I try to scroll down any further the keyboard begins to appear. My finger, meanwhile, is in the middle of the table.

enter image description here

like image 595
n00bProgrammer Avatar asked Dec 26 '22 10:12

n00bProgrammer


1 Answers

This effect can be achieved by setting the scrollview's keyboardDismissMode to UIScrollViewKeyboardDismissModeInteractive and then in scrollViewDidScroll: calling [textField becomeFirstResponder];. Because you are in the middle of scroll, the keyboard will respect the keyboardDismissMode property and interactively appear. Drop the DAKeyboardControl; it's outdated.

like image 140
Léo Natan Avatar answered May 02 '23 12:05

Léo Natan