Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to show pull up to refresh control in the bottom of tableview?

Tags:

ios

In the tableView , when I am pulling down from the top, it is fetching the data. But if I want pulling up the data from the bottom in tableView, how can I implement, please suggest me

like image 992
Tinku Avatar asked May 25 '15 11:05

Tinku


People also ask

How do you add a pull to refresh to a table view or collection view?

You can add a refresh control to a table or collection view by assigning an instance of the UIRefreshControl class to this property. If your application targets versions prior to iOS 10, you simply add the refresh control as a subview to the table view.

What is UITableView in Swift?

A view that presents data using rows in a single column.


3 Answers

I too stucked with such a situation and at last i found some answers like UIRefreshControl at the bottom of the UITableView iOS6? and thus implemeted our UIActivityIndicatorView in footerview. Thus it is working fine Now.

    // call this method in `viewDidLoad` and connect the tableview delegates.

    -(void)initializeRefreshControl
    {
        indicatorFooter = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableVeiwMarkets.frame), 44)];
        [indicatorFooter setColor:[UIColor blackColor]];
        [indicatorFooter startAnimating];
        [self.tableVeiwMarkets setTableFooterView:indicatorFooter];
    }

    -(void)refreshTableVeiwList
    {
// your refresh code goes here
    }
    -(void)scrollViewDidScroll: (UIScrollView*)scrollView
    {
        if (scrollView.contentOffset.y + scrollView.frame.size.height == scrollView.contentSize.height)
        {
            [self refreshTableVeiwList];
        }
    }
like image 69
Sudhin Davis Avatar answered Oct 20 '22 07:10

Sudhin Davis


Please find the below control for show the pull to refresh at bottom of tableview

URL : https://github.com/vlasov/CCBottomRefreshControl

like image 24
Ramkrishna Sharma Avatar answered Oct 20 '22 06:10

Ramkrishna Sharma


I've made this Swift library to add pull to refresh to the bottom of UITableview.

https://github.com/marwendoukh/PullUpToRefresh-iOS

I hope this help you.

like image 22
Marwen Doukh Avatar answered Oct 20 '22 07:10

Marwen Doukh