2

I've been battling with this for a while. The core issue is that my cells in a UICollectionView are disappearing when they are highlighted. I have no need for highlighting on my app, just selecting, so i've set:

func collectionView(collectionView: UICollectionView, shouldHighlightItemAtIndexPath indexPath: NSIndexPath) -> Bool {
    return false
}

which means i'm not getting the highlight callbacks, or the undesired behaviour, but i'm no longer able to select items, even when setting:

func collectionView(collectionView: UICollectionView, shouldHighlightItemAtIndexPath indexPath: NSIndexPath) -> Bool {
    return true
}

didSelectItemAtIndexPath is not getting called.

Am i missing a flag or something?

Any help greatly appreciated!

theSiberman
  • 441
  • 4
  • 14

1 Answers1

0

It is by design so:

This issue behaves as intended based on the following:
The sequence is:
if shouldHighlight == YES
didHighlight
shouldSelect
didSelect
Highlighting is pre-condition to selection.

By avedesk at Oct. 11, 2016, 9:37 p.m. (reply...)

Source

Fran Pugl
  • 464
  • 5
  • 6