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)
}
Author by
Fabio Cenni
Updated on September 05, 2020Comments
-
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 myprototype cell
background is red, touching up inside a cell its background color begin blue and scrolling thetableView
background color return red. Is it possible to do this?!Thanks in advance.