iOS 14.2系统下shouldSelectItemAtIndexPath自动触发

在iOS14.2系统下,UICollectionview会自动触发下面的方法:

-(BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath;

解决方案:
苹果暂未给出方案,苹果官方问题
我们的做法是,将shouldSelectItemAtIndexPath方法收拢到didSelectItemAtIndexPath:

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

你可能感兴趣的:(iOS 14.2系统下shouldSelectItemAtIndexPath自动触发)