Prevent UITableView scrolling below a certain point

Question!

How can I have a UITableView that permits scrolling above a certain index row, but prevents it when it below a certain point? For example, if I have rows 1 through 100, where only 5 appear in the view at a given time, I want to allow a user to scroll among rows 1-50, but prevent any further scrolling down when row 50 is visible.



Answers

UITableView is a subclass of UIScrollView. This means you can use all methods from UIScrollViewDelegate. Try adding the scrollView.contentOffset logic in the following delegate method:

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView;
By : Evol Gate


This video can help you solving your question :)
By: admin