How do I know that the UICollectionView has been l

2019-01-08 09:17发布

I have to do some operation whenever UICollectionView has been loaded completely, i.e. at that time all the UICollectionView's datasource / layout methods should be called. How do I know that?? Is there any delegate method to know UICollectionView loaded status?

13条回答
做自己的国王
2楼-- · 2019-01-08 09:42

This is how I solved problem with Swift 3.0:

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    if !self.collectionView.visibleCells.isEmpty {
        // stuff
    }
}
查看更多
登录 后发表回答