Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView does not scroll when keyboard appears

UITableView does not auto-scroll when a UITextField/UITextView becomes the first responder. It used to work just fine on iOS 9-11, but now it doesn't work anymore on iOS 12.
What should I set up or change in the tableView to fix the behavior?

Reference GIF

enter image description here

like image 703
Ruslan Avatar asked Oct 10 '18 08:10

Ruslan


1 Answers

I found solution in the code, as you said. This part of code was blame:

if #available(iOS 11.0, *) {
    tableView.contentInsetAdjustmentBehavior = .never
} else {
    automaticallyAdjustsScrollViewInsets = false
}
like image 183
Ruslan Avatar answered Nov 10 '22 23:11

Ruslan