0

When I remove all object from tableview and with animation reload tableview at that time tableview getting flicker.

I am doing something like this:

-(void)viewDidLoad {

    [super viewDidLoad];

    self.voiceSTableView.voicestationDelegate = self;

    refreshControl = [[UIRefreshControl alloc] init];

    [refreshControl addTarget:self action:@selector(getRefreshData) forControlEvents:UIControlEventValueChanged];

    UITableViewController *tableViewController = [[UITableViewController alloc] init];

    tableViewController.tableView = self.voiceSTableView ;

    tableViewController.refreshControl = refreshControl;

    self.voiceSTableView.refreshController = refreshControl;


}

-(void)getRefreshData{

    if(isRequestLoading){
        [refreshControl endRefreshing];
        return;
    }
    [self.voiceSTableView.arVoicerData removeAllObjects];
    [UIView animateWithDuration:0 animations:^{
        [self.voiceSTableView reloadData];
    } completion:^(BOOL finished) {
    }];
 }

even this code also not working :

[self.voiceSTableview reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
Rumin
  • 3,787
  • 3
  • 27
  • 30
riddhi
  • 316
  • 2
  • 16

1 Answers1

0

I have also face same issue earlier.

Please try with this link:

"UIRefreshControl on viewDidLoad"

Community
  • 1
  • 1
Shubham Narang
  • 514
  • 2
  • 14