I
I
Istergul2014-06-05 21:22:21
Objective-C
Istergul, 2014-06-05 21:22:21

How to properly display UIActivityIndicatorView on UICollectionView?

Hello.
UICollectionView dynamically loads elements from the network. One line has 2 elements. When the user scrolls to the bottom, a new piece of data is loaded.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    NSInteger currentOffset = scrollView.contentOffset.y;
    NSInteger maximumOffset = scrollView.contentSize.height - scrollView.frame.size.height;
    
    if ((maximumOffset - currentOffset <= 70.0) && (self.requestSended == NO)) {
        NSRange range = NSMakeRange(self.products.allKeys.count, 10);
        [self loadProductsWithRange:range];
    }
}

Tell me how to correctly display UIActivityIndicatorView at the moment when a new piece of data is being loaded?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question