Search code examples
iosviewwillappear

How to stop NetworkActivityIndicator, after the data loading process


I'm loading data into a collectionview from a json feed. I have set a network activity indicator in my viewWillappear method.it works fine. But I want to stop it when data loading is finished.How can I do that.


Solution

  • In the code which reloads your UICollectionView, you can just switch the network activity indicator off, e.g.

    [collectionView reloadData];
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;