The first problem is that the UITableView is partially hidden under the keyboard. Therefore, when you try to scroll to the bottom row, the table will go back and the necessary content will not be visible.
To solve this problem, when the keyboard appears / hides, you have two options.
self.tableView.contentInstet.bottom update self.tableView.contentInstet.bottom to take into account keyboard size- refresh the table frame, if you use auto-layout, then the best approach would be to update the constant part of the lower constraint (IMO is the best approach).
After that you can do this:
CGRect rectToBeVisible = [currentButton convertRect: currentButton.bounds toView: self.tableView]; [self.tableView scrollRectToVisible: rectToBeVisible animated: YES];
I could ruin the view to which you want to convert, so experiment a little, but the general concept should be clear.
source share