Swift - UITableView scroll event

Kaaseter picture Kaaseter · May 12, 2015 · Viewed 28k times · Source

I was wondering how to detect if the UITableView is scrolled (up or down). I want to hide the keyboard when the UITableView is scrolled with self.view.endEditing(true).

Thanks in advance

Answer

Daniil Chuiko picture Daniil Chuiko · Oct 28, 2016

You can set property of UITable view (XCode 7+)

In Storyboard:
In Storyboard

in Code:

tableView.keyboardDismissMode = .onDrag