SVPullToRefresh icon indicating copy to clipboard operation
SVPullToRefresh copied to clipboard

Stop activity indicator after receiving data from API

Open ZoebHusainSheikh opened this issue 10 years ago • 4 comments

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?

ZoebHusainSheikh avatar Sep 09 '14 06:09 ZoebHusainSheikh

Hi @zsheikh-systango do u got solution? i am to want it...will u help me?

skmohanraj avatar Jan 29 '15 12:01 skmohanraj

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

ZoebHusainSheikh avatar Jan 29 '15 12:01 ZoebHusainSheikh

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.

skmohanraj avatar Jan 29 '15 12:01 skmohanraj

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];

    });

skmohanraj avatar Jan 31 '15 10:01 skmohanraj