Instagram / Instagram/IGListKit

Selecting cell calls different SectionController's didSelect method

Open
#1,257 6 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Objective-C
Stars
13.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

## New issue checklist

- [ ✅] I have reviewed the [`README`](https://github.com/Instagram/IGListKit/blob/master/README.md) and [documentation](http://instagram.github.io/IGListKit)
- [ ✅] I have searched [existing issues](https://github.com/Instagram/IGListKit/issues) and this is not a duplicate

### General information

- `IGListKit` version: 3.4.0
- iOS version(s): 10-11-12
- CocoaPods/Carthage version:
- Xcode version: 10.0
- Devices/Simulators affected:
- Reproducible in the demo project? (Yes/No): No
- Related issues:

Hello everyone! 👋

I have a strange bug with my ListSectionController subclasses, or (which is more likely) I misunderstood something.
I have a UICollectionvVew with 4 different types of data. Thus I have 4 ListSectionController subclass, one for each type of section. One section's cells are needed to be clickable, so I can navigate to a new screen depending the data in the cell. I simply implement the didSelectItem(at index: Int) method in the proper subclass.

My problem is that the other type of sections seem to implement this same method. 🤔
Imagine you have A, B and C type of sections, with different types of cells. I want to navigate to a new screen if I click a cell in A section, and do nothing if I click in B or C. But instead If I click B's or C's cell the same method is called (WHICH IS ONLY IMPLEMENTED IN ASectionController 🤯😡) and I navigate to a new screen. (Cell click in A works fine though...)

I cannot understand this issue, please help me how can I fix that? I think it's in connection with that the collectionView reuses cells maybe.

Any andvice is welcomed! 🙌🏻

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.