UICollectionView 笔记

不在

- (void)collectionView:(UICollectionView*)collectionView didSelectItemAtIndexPath:(NSIndexPath*)indexPath

代理方法里面刷新 只需

- (void)reloadSelf {

    [CATransaction setDisableActions:YES];

    [self reloadData];

    [CATransaction commit];

}

但是在代理里面刷新 需要添加

[UIView performWithoutAnimation:^{

        [selfreloadSelf];

    }];

求大神指点差异  reloadSelf是去掉隐式动画 在代理里面为什么还需加一层

swift 版本

func ff_reload() {

        CATransaction.setDisableActions(true)

        vv_collectV.reloadData()

        CATransaction.commit()

    }

UIView.performWithoutAnimation {

                        self.ff_reload()

                    }

现在写swift中 经过测试 还是有闪屏 试一下部分刷新

vv_collectV.reloadItems(at: [indexPath])

在频繁点击中单刷是OK的 但是有时需要全部刷新

现在测试ff_reload方法是否OK 

有外界调用刷新直接vv_collectV.reloadData() 和ff_reload() 肉眼差别不大

那么如果不是频率原因 是因为点击cell时发生了什么导致的吗

后续更新中。。。。。。

你可能感兴趣的:(UICollectionView 笔记)