I have one of my tabs:
- (void)viewDidLoad
{
[super viewDidLoad];
self.clearsSelectionOnViewWillAppear = YES;
UIRefreshControl* refreshControl = [[UIRefreshControl alloc] init];
refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Sync"];
[refreshControl addTarget:self
action:@selector(refresh:)
forControlEvents:UIControlEventValueChanged];
self.refreshControl = refreshControl;
dispatch_async(dispatch_get_main_queue(), ^
{
[self.refreshControl beginRefreshing];
[self.refreshControl endRefreshing];
});
}
- (void)refresh:(id)sender
{
if ([Settings sharedSettings].haveAccount == YES)
{
[[DataManager sharedManager] synchronizeWithServer:^(NSError* error)
{
[sender endRefreshing];
}];
}
else
{
[sender endRefreshing];
}
}
The refresh slider starts to spin normally when the table is pulled.
However, when I, while it rotates, briefly displays another tab, and then returns, the update control stops rotating.
Any idea why?
source
share