Reputation: 35070
I have a UICollectionView
, and when selecting an item didDeselectItemAt
not get triggered, but when selecting an other item, the first will get triggered. Why?
This is have method is implemented:
override func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
let userSetting = userSettings[(indexPath as NSIndexPath).row]
selectedUserSettingRecordName = userSetting.id
containerViewController!.performSegue(withIdentifier: "message", sender:self)
}
There is no view above the collectionView
which could interfere.
Upvotes: 4
Views: 1699
Reputation: 82759
is not
didDeselectItemAt - is called in second time, if you select the any item after that it will call
override func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
it is
didSelectItemAt - is called in first time, if you select the any item it will call
override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
Upvotes: 8