-(void)fetchNewsFeeds:(NSInteger)off_Set withLimit:(NSInteger)limitFeeds
{
[[FriendflyLoader sharedLoader] show];
NSLog(@"NewsFeed Count Before Call : - %lu",(unsigned long)newsFeedsArray.count);
NSString *offcet=[NSString stringWithFormat:@"%ld",(long)off_Set];
NSString *New_limit =@"20";//[NSString stringWithFormat:@"%ld",(long)limitFeeds];
[[Model sharedInstance] fetchnewsFeedsFiltered:isFiltered fetchAllGroups:fetchAllGroups fetchUnassigned:fetchUnassigned fetchGroups:fetchGroups fetchAllContacts:fetchAllContacts fetchFriendFlyContacts:fetchFriendFlyContacts withoffset:offcet andlimit:New_limit withViewAllPost:viewAllPost includeNetworks:networks onCompletion:^(BOOL success, NSArray *feeds) {
if(success)
{
isLoadMore = true;
newsFeedsArray = [NSMutableArray arrayWithArray:feeds];
filteredArray = [NSMutableArray arrayWithArray:newsFeedsArray];
NSLog(@"NewsFeed Count After Call : - %lu",(unsigned long)newsFeedsArray.count);
newsFeedTableview.delegate = self;
newsFeedTableview.dataSource = self;
[newsFeedTableview needsUpdateConstraints];
[newsFeedTableview reloadData];
[[FriendflyLoader sharedLoader] hide];
[newsFeedTableview needsUpdateConstraints];
[refresh endRefreshing];
}
else{
NSLog(@"Api Not Call_______");
}
}];
}
//Call Api using willDisplayCell but First time okay but second time constant Call runing like loop
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
NSInteger lastSectionIndex = [tableView numberOfSections] - 1;
NSLog(@"section = %ld && Last Count = %ld && isLoadMore = %@",indexPath.section,lastSectionIndex,isLoadMore ? @"True":@"False");
if (indexPath.section == lastSectionIndex && indexPath.row == 0 && isLoadMore ) {
[self fetchNewsFeeds:(filteredArray.count + 1) withLimit:20];
}
}
Asked
Active
Viewed 435 times
0

Apurv
- 17,116
- 8
- 51
- 67

Bhavesh Rathod
- 178
- 1
- 1
- 8
-
i think this may helpful for you stackoverflow.com/questions/8642699/uitableview-scroll-event – seggy Jan 10 '17 at 12:11
-
Do you mind elaborating your problem in words? – Adeel Miraj Jan 10 '17 at 13:03
-
What seems to be the problem you are currently facing? – Rikh Jan 10 '17 at 13:04
1 Answers
0
Please see this and this post.
// ... setting up the table view here ...
self.tableView.delegate = self;
// ...
// Somewhere in your implementation file:
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
NSLog(@"Will begin dragging");
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
NSLog(@"Did Scroll");
}
You can get the offset value from here
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
NSIndexPath *firstVisibleIndexPath = [[self.tableView indexPathsForVisibleRows] objectAtIndex:0];
NSLog(@"first visible cell's section: %i, row: %i", firstVisibleIndexPath.section, firstVisibleIndexPath.row);
}

Community
- 1
- 1

Shuvo Joseph
- 894
- 1
- 12
- 21