collectionView(_:didDeselectItemAt:)
Tells the delegate that the item at the specified path was deselected.
Declaration
optional func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath)Parameters
- collectionView:
The collection view object that is notifying you of the selection change.
- indexPath:
The index path of the cell that was deselected.
Discussion
The collection view calls this method when the user successfully deselects an item in the collection view. It does not call this method when you programmatically deselect items.
See Also
Managing the selected cells
Changing the appearance of selected and highlighted cellsSelecting multiple items with a two-finger pan gesturecollectionView(_:shouldSelectItemAt:)collectionView(_:didSelectItemAt:)collectionView(_:shouldDeselectItemAt:)collectionView(_:shouldBeginMultipleSelectionInteractionAt:)collectionView(_:didBeginMultipleSelectionInteractionAt:)collectionViewDidEndMultipleSelectionInteraction(_:)