UICollectionView only calling didSelectItemAtIndexPath if user double taps, will not call when user single taps

前端 未结 14 1676
名媛妹妹
名媛妹妹 2020-12-07 18:58

I have a UICollectionView which is about the size of the screen. The UICollectionViewCells that it displays are the same size as the collectionView. Each cell has a UIImage

14条回答
  •  旧时难觅i
    2020-12-07 19:09

    Try removing all of your UIGestures from the view then test to see if the UICollectionView Cells are able to be interacted with normally.

    In my case, I had to remove the lines:

    let tap = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
        self.view.addGestureRecognizer(tap)
    

提交回复
热议问题