I'm having a problem implementing UIRefreshControl - in that when you pull down, the 'blob' works perfectly fine and the refresh spinner works fine, but the tableView doesn't scroll up to the spinner whilst refreshing. Instead, it stays where it was until the refreshing is complete, at which point it returns to the top of the screen
The code that does the refreshing is:
- (void)viewDidLoad {
self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self action:@selector(refreshView:)forControlEvents:UIControlEventValueChanged];
}
- (void)refreshView:(UIRefreshControl *)refresh {
dispatch_async(dispatch_get_main_queue(), ^{
(...code to get new data here...)
[self.refreshControl endRefreshing];
}
}
I found that without dispatch_async, even the refresh spinner doesn't work - and the bit that was pulled down appears just white
Does anyone have any clues what I could be doing wrong? All implementation examples I've found seems to match what I'm doing, and I haven't found anything in the API docs that suggest I'm missing anything out