UIRefreshControl continuously animates even if it is not displayed

I added UIRefreshControlin UITableView, and it seems to be constantly animated, even if it doesn't appear.

Running frankly_map "view:'_UIRefreshControlModernReplicatorView'", "isAnimating"through the Frank Console shows that the erroneous view is actually a private UIKit _UIRefreshControlModernReplicatorViewthat continues to animate the screen.

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

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

I have included an important bit of 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];
    });
}
+3
source share
1 answer

Before hiding it, stop the update using the following code:

[refrshControl endRefreshing];
+2
source

All Articles