3

I've added a UIRefreshControl to a UITableView and it appears to be continuously animating, even when it is not visible.

Running frankly_map "view:'_UIRefreshControlModernReplicatorView'", "isAnimating" through Frank console reveals that the erroneous view is in fact the private UIKit _UIRefreshControlModernReplicatorView which continues to animate off screen.

Any suggestions on why this is happening or how to halt the animation?

Replication Repo => https://github.com/samst0r/UIRefreshControlFrank

I've included the important bit of the code =>

- (void)viewDidLoad
{
    [super viewDidLoad];

    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];

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

    self.refreshControl = refreshControl;
}

#pragma mark - Other

- (void)refresh {

    double delayInSeconds = 2.0;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        [self.refreshControl endRefreshing];
    });
}
Sam Ward
  • 43
  • 1
  • 6

1 Answers1

2

Before you hide it, stop the refreshing with the following code:

[refrshControl endRefreshing];
Lord Zsolt
  • 6,492
  • 9
  • 46
  • 76
  • So I've included the code snippets above. I'm already calling `endRefreshing` (for arguments sake after 2 seconds). Any other ideas? – Sam Ward Feb 09 '14 at 11:26