1

How do I start a function after the Collection View is fully loaded?

I use override func layoutSubviews() but It's not working the way I want it to.

Thanks.

Spartacus9
  • 164
  • 2
  • 18

1 Answers1

1

Do as follow (obj - c)

- (void)collectionView:(UICollectionView *)collectionView 
       willDisplayCell:(UICollectionViewCell *)cell 
    forItemAtIndexPath:(NSIndexPath *)indexPath{

    if([indexPath row] == ((NSIndexPath*)[[collectionView indexPathsForVisibleRows] lastObject]).row){
        //end of loading, now your collection view is fully loaded.
        // Now call the method you wanted to call
    }
}
dahiya_boy
  • 9,298
  • 1
  • 30
  • 51