如何在完全加载Collection View后启动一个函数?
我使用覆盖func layoutSubviews()
,但它没有按照我想要的方式工作。
感谢。
答案 0 :(得分:0)
按照以下步骤(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
}
}