Kirill Kharkovsky
Ну метод у меня есть collection view при нажатии ячейка выделяется, а при повторном нажатии нужно снимать выделение
func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool {
let item = collectionView.cellForItem(at: indexPath)
if item?.isSelected ?? false {
collectionView.deselectItem(at: indexPath, animated: true)
} else {
collectionView.selectItem(at: indexPath, animated: true, scrollPosition: [])
return true
}
return false
}
попробуй это