The contentOffset is the distance between the origin of your frame (0, 0) and the origin of the first cell.
Initially, the contentOffset is zero. If you've scrolled past the top of the list (dragging finger downwards), then the contentOffset will be negative. If you've scrolled down the list (first cell is above the frame), then the contentOffset will be positive.
#pragma mark - UIScrollViewDelegate
-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat maxOffset = (scrollView.contentSize.height - scrollView.frame.size.height);
CGFloat originOffset = 0;
// Don't scroll below the last cell.
if (scrollView.contentOffset.y >= maxOffset) {
scrollView.contentOffset = CGPointMake(scrollView.contentOffset.x, maxOffset);
// Don't scroll above the first cell.
} else if (scrollView.contentOffset.y <= originOffset) {
scrollView.contentOffset = CGPointZero;
}
}