UICollectionView selectItemAtIndexPath doesn't call didSelectItemAtIndexPath

后端 未结 4 1948
眼角桃花
眼角桃花 2021-02-07 12:22

I have a collection view. I would like to programmatically select a cell. This is the code I use

[_collectionView selectItemAtIndexPath:[NSIndexPath indexPathFor         


        
4条回答
  •  天涯浪人
    2021-02-07 12:43

    Yes, this is proper behaviour. Documentation for [selectItemAtIndexPath:animated:scrollPosition:] says:

    This method does not cause any selection-related delegate methods to be called.

提交回复
热议问题