Reload UICollectionView header or footer?

前端 未结 10 1187
余生分开走
余生分开走 2020-12-08 02:35

I have some data that is fetched in another thread that updates a UICollectionView\'s header. However, I\'ve not found an efficient way of reloading a supplementary view suc

10条回答
  •  温柔的废话
    2020-12-08 03:12

    This question is very old but a simple way to do it is to just set a delay that covers the time your view is animating and disabling the animation while you update the view...usually a delete or insert takes about .35 seconds so just do:

     delay(0.35){
                UIView.performWithoutAnimation{
                self.collectionView.reloadSections(NSIndexSet(index: 1))  
                }
    

提交回复
热议问题