Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pull down UItableView to switch view controller

I have to design a view controller that has top view controller and bottom view controller. And the root view of top view controller is UITableView. As we know, super view of UITableView is UIScrollView, so i want to modify the UITableView that when pull over 60px, it will show the bottom view controller. I have read the UITableView and UIScrollView class reference again and again, but can not find any solution for this. Does anyone know it? Thanks.

enter image description here

====================================================================================================================================================================

I have solve with it. please check https://github.com/yishuiliunian/DZPullDownViewController.git

like image 750
dzpqzb Avatar asked Jul 01 '26 17:07

dzpqzb


1 Answers

Implement UIScrollViewDelegate methods in your view controller (which contains UITableView):

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
    if(self.tableView.contentOffset.y<-70)
    {
       // Write your code here (To load new view controller)
    }
}

Hope this helps.

like image 81
Mrunal Avatar answered Jul 04 '26 07:07

Mrunal