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
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
You can add
UIScrollViewDelegate
. After that you can implementscrollViewDidScroll
method.I believe the complete solution would be the following:
The previous answers weren't 100% accurate.
Explanation: scrollViewDidEndDragging will be called when the scrolling stops, therefore we save the last know offset. After that we compare it with the current offset in the delegate method scrollViewDidScroll.
You can set property of UITable view (XCode 7+)
In Storyboard:
in Code: