CollectionViewDelegateProtocol includes seven optional functions.

  • collectionView:didDeselectItem:andSection: this function is invoked when the item at the specific index path was selected.
  • collectionView:didHighlightItem:andSection: this function is invoked when the item at the specific index path was highlighted.
  • collectionView:didSelectItem:andSection: this function is invoked when the item at the specific index path was selected.
  • collectionView:didUnhighlightItem:andSection: this function is invoked when the item at the specific index path was unhighlighted.
  • collectionView:shouldDeselectItem:andSection: Returns if the specific item should be deselected.
  • collectionView:shouldHighlightItem:andSection: Returns if the specific item should be highlighted. 
  • collectionView:shouldSelectItem:andSection: Returns if the specific item should be selected.
Did this answer your question?