I'm facing with a simple but tedious problem. What I'm trying to do is make an UITableView to page like an UIScrollView but enabling paging doesn't help me so much because I can't set page size so the tableview scrolls exactly of its height so it shows rows 1...10 or 11...20 and so on. What I'd like instead is that no cell remains clipped above or under the view when I scroll (thus paging) without having a sort of fixed range of shown cells.
Thanks a lot
Simple but efficient:
Starting with k06a's answer, I've refined it a bit so it works more like the real paginated UITableView. The differences in behaviour are quite noticeable with full screen table rows. Even a mini-flick in either direction should scroll the table to the next page: I do this by checking velocity first.
Note that additionally setting
in
viewDidLoad:
makes it closer to the real thing, but not quite.I've been fiddling with setting even faster deceleration rates using the code shown here but I couldn't get it right.
And in Swift...
This works like real paging:
and make this in
-viewDidLoad
:More simple and more efficient :)