SVPullToRefresh
SVPullToRefresh copied to clipboard
Stop activity indicator after receiving data from API
Hey, currently I found this code to stop activity indicator in demo project.
[weakSelf.tableView.infiniteScrollingView stopAnimating]; (inside "insertRowAtBottom" method)
But it calls after 2 sec. I want to stop animation once I get the response from API.
so I wrote this stopAnimating line after API response. Is there any better way to achieve this?
Hi @zsheikh-systango do u got solution? i am to want it...will u help me?
Yes, instead of calling [self.tableView.infiniteScrollingView stopAnimating]; inside |insertRowAtBottom| method
you have to call just after API response. also make sure if you are not making call because of any validation then call [self.tableView.infiniteScrollingView stopAnimating]; else it won't stop animating and you will face other issues
Thanks for quick reply, I have write inside the insertRowAtBottom , it can only once success, When i second time scroll in the bottom, issue again happened and Activity indicator shows infinitely.
I was Resolve my issue by Replace
[self.tableView.infiniteScrollingView stopAnimating];
By dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self.tableView..infiniteScrollingView stopAnimating];
});