Tinku
Tinku

Reputation: 247

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

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

Upvotes: 8

Views: 17634

Answers (5)

Marwen Doukh
Marwen Doukh

Reputation: 2050

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.

Upvotes: 1

Chris Prince
Chris Prince

Reputation: 7584

I just rolled my own "pull up to refresh" Cocoapod: https://cocoapods.org/pods/LottiesBottom It's based off Lottie by airbnb. You can plugin which ever Lottie animation you want.

Upvotes: 0

iAnurag
iAnurag

Reputation: 9346

You can use MNMBottomPullToRefresh for this. its easy to use

1) Copy the whole MNMBottomPullToRefresh folder into your project

2) In your UIViewController class, create a MNMBottomPullToRefreshManager to link an UITableView and the MNMPullToRefreshView. Use a sentence like this in viewDidLoad:

pullToRefreshManager_ = [[MNMBottomPullToRefreshManager alloc] initWithPullToRefreshViewHeight:60.0f tableView:table withClient:self];


- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[pullToRefreshManager_ tableViewScrolled];
}


- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate: (BOOL)decelerate
 {
  [pullToRefreshManager_ tableViewReleased];
 }


- (void)bottomPullToRefreshTriggered:(MNMBottomPullToRefreshManager *)manager
  {
   //method to get more data 
  // [self CallWebServiceToLoadMorePAYMENTS];

  }
}

After reloading tableview call

[pullToRefreshManager_ tableViewReloadFinished];

Upvotes: 0

Ramkrishna Sharma
Ramkrishna Sharma

Reputation: 7019

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

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

Upvotes: 4

Sudhin Davis
Sudhin Davis

Reputation: 2020

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];
        }
    }

Upvotes: 15

Related Questions