Uirefreshcontrol Glitching in Combination with Custom Tableviewcell

UIRefreshControl glitching in combination with custom TableViewCell

The way I avoid the above glitch nowadays is by delaying the tableView.reloadData() call for a small amount of time:

self.tableView.refreshControl?.endRefreshing()
self.tableView.perform(#selector(self.tableView.reloadData), with: nil, afterDelay: 0.05)

Not really a fix but more of a hack in my opinion.

UIRefreshControl endRefresh jumps when used with Large Title enabled

The problem is related to layout.estimatedItemSize = CGSize(width: 20, height: 20)

When we use AutoLayout to resize the cell, it creates a bug with UIRefreshControl and navigation bar large title. So, if you use layout.estimatedItemSize with an equal or greater size than we expected. So the bug will not happen and the glitch will not happen.

Basically, the problem is when we call updateData but the cell is bigger than we expect and each cell of the UICollectinView will resize to a bigger size then the UICollectionViewController will glitches.

Header Displaced in TableView with UIRefreshControl

This could be an issue due to the fact that you are adding _refreshControl as a subview which is not supposed to be done. However you can create a UITableViewController object add it as the child view controller of your current viewcontroller class.

For eg:-

UITableViewController *tableViewController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain];
[self addChildViewController:tableViewController];

tableViewController.refreshControl = [[UIRefreshControl alloc] init];
[tableViewController.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
tableViewController.tableView.frame = CGRectMake(...);//set the frame here
[self.view addSubview:tableViewController.tableView];


Related Topics



Leave a reply



Submit