I am trying to implement paging for custom sized pages in the UITableView. What I am trying to achieve is to have the top of the active cell align with the top of the tabl
Implement scrollViewWillEndDragging:withVelocity:targetContentOffset:
to return top coordinate of the cell closest to targetContentOffset
, not closest to your starting offset. The solution jjv360 provided does that well, but you might want to tweak it a bit depending on how high your cells are on average (jjv360's solution might be too snappy on really big cells).
I would just like to add that you can make UITableView
's deceleration faster to behave more like paged UIScrollView
by changing its decelerationRate
property (just do it once in init/viewDidLoad/wherever).
self.tableView.decelerationRate = UIScrollViewDecelerationRateFast;