How to know that tableView started scrolling

20,431

UITableView inherits from UIScrollView and UITableViewDelegate extends UIScrollViewDelegate.

Particularly you may be interested in scrollViewDidScroll method. So, in your UITableViewDelegate implementation, add the following method:

func scrollViewDidScroll(_ scrollView: UIScrollView) {
    NSLog("Table view scroll detected at offset: %f", scrollView.contentOffset.y)
}
Share:
20,431
Fabio Cenni
Author by

Fabio Cenni

Updated on September 05, 2020

Comments

  • Fabio Cenni
    Fabio Cenni over 3 years

    I have a doubt: is there any way to intercept a tableView scrolling to add it an action? For example my prototype cell background is red, touching up inside a cell its background color begin blue and scrolling the tableView background color return red. Is it possible to do this?!

    Thanks in advance.