Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIRefreshController Ending Animation Issue

When I call for self.refreshControl.endRefreshing() it snaps the tableView back to it original spot like it should. How should I go about animating it so that it fluently returns to its original spot on endRefreshing()?

like image 781
uhfocuz Avatar asked Dec 03 '14 19:12

uhfocuz


3 Answers

Try this

[CATransaction begin];
[CATransaction setCompletionBlock:^{
    // reload tableView after refresh control finish refresh animation
    [self.tableView reloadData];
}];

[self.refreshControl endRefreshing];
[CATransaction commit];
like image 116
rowwingman Avatar answered Sep 30 '22 18:09

rowwingman


To anyone having this issue, you must call your endRefreshing method before you reload the table data. Otherwise when the table updates it will override the refresher and cause it to look buggy.

like image 30
uhfocuz Avatar answered Sep 30 '22 17:09

uhfocuz


I was having this issue and tried every suggestion above (and others from similar threads).

What the problem turned out to be in my case was... I hadn't enabled refreshing in interface builder. I only added the code to create a refresh control and listen for the value changed event. It worked, but was "jumpy" as others have described.

Enabling it in interface builder fixed my problem. If you've tried everything else, check your storyboard!

Enable Refreshing in your storyboard!

like image 42
Devin Avatar answered Sep 30 '22 19:09

Devin