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
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.
A view that presents data using rows in a single column.
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];
}
}
Please find the below control for show the pull to refresh at bottom of tableview
URL : https://github.com/vlasov/CCBottomRefreshControl
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With