UITableView, force to snap to whole UITableViewCell at top of table
- by Adam Eberbach
I have a need to make a UITableView only display whole cells at the top of the cell, so when the table is moved or scrolled it should animate to make a whole cell visible at the top of the table if it has happened to stop with a cell partially off the top. This can be easily done using visibleCells and scrollToRowAtIndexPath methods of UITableView, BUT the cell should not always scroll down to move the partial cell into view - if the cell at top is more than 50% gone it should go completely with the next cell (i.e. index 1 in the array returned by visibleCells) moving to the top of the table.
I've tried a few things to make this happen but I don't think I am understanding the way frame and bounds work between a UITableView and its UITableViewCells. Any help?