Is it possible to let UITableview move up/down whole cell height just like date picker (not stop between the cell top and bottom)?
-
See my SO answer pertaining to UIScrollView [here](https://stackoverflow.com/a/45657686/8441876). – Smartcat Sep 22 '17 at 03:11
1 Answers
The class UITableView
is a subclass of UIScrollView
.
This means that, if the object you specified as your table view's delegate
also adopts the UIScrollViewDelegate protocol, that protocol's methods will be called on it whenever the relevant scroll events happen on the table view.
You can use that timing to "fix" the table view's scroll offset in just the right way to simulate the snap-to-row-bnoundary behaviour you're after.
Some examples:
scrollViewDidEndDragging(_:willDecelerate:)
: Tells the delegate when dragging ended in the scroll view.scrollViewDidEndDecelerating(_:)
: Tells the delegate that the scroll view has ended decelerating the scrolling movement.
Which methods to implement, and what exactly to do in their implementations, will depend on what effect you want to achieve. Play around and see.

- 16,006
- 8
- 81
- 189