ExpandableCell
ExpandableCell copied to clipboard
Cells randomly disappearing and titleLabel.text displays wrong text
Hey. I have 11 ExpandableCells and about 50 ExpandedCells. I am initializing it like that:
func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCellsForRowAt indexPath: IndexPath) -> [UITableViewCell]? {
`var cells: [ExpandedCell] = []
for i in 0...platinumProteinMeals[indexPath.row].meals.count - 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: ExpandedCell.ID) as! ExpandedCell
print("\(indexPath) | \(i) | \(platinumProteinMeals[indexPath.row].meals[i])")
cell.titleLabel.text = platinumProteinMeals[indexPath.row].meals[i]
cell.isHidden = false
cells.append(cell)
}
return cells
}`
The platinumProteinMeals is an array of 11 NDDSections, one section would look like this:
NDDSection(category: "Beef", meals: ["Beef Avocado Salad", "Beef in Chili Sauce", "Beef Soup", "Beef Steak", "Beef Tartar", "Beef with French Beans", "Chilli Lime Beef", "Thai Beef Salad"])
My issue is that the cell randomly disappears (mostly while scrolling) and a wrong meal of themeals array is getting displayed. For example a Turkey meal is being displayed in the Beef ExpandableCell. Any idea how to fix this? Thanks in advance
I have the same issue. When scrolling, the expanded cells randomly disappear

@younatics I have same problem
@andrei0929 @Marolicious @kwongius @ezefranca @kennydust
I added
tableView.reloadData()
in the end of the the function of
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
waiting you respond if this helped you or not
it is not the best solution I known but may be help
@Marolicious @andrei0929 @kwongius @ezefranca @kennydust waiting your respond
@NrmeenTomoum Although I wasn't implementing the didSelectRowAt indexPath method, I called reloadData in the method but it didn't help me
are you added tableView.reloadData() at the End of didSelectRowAt func in ExpandableTableView.swift File created by @younatics ? @andrei0929
@NrmeenTomoum @andrei0929 I have same problem. Did you find any solution other than tableView.reloadData()?
edited: It happens when I work with data that can't fit in single screen
@damir18yo I didn't do any think more than added tableView.reloadData() at the End of didSelectRowAt func in ExpandableTableView.swift File created by @younatics after that disappeared cell problem appears from scrolling disappeared .
@NrmeenTomoum I tried your solution but animation becomes very weird
try to made animation of table . middle @damir18yo
Faced the same problem. Maybe someone knows a good solution to this problem?
@NrmeenTomoum Your advice works, but because of it the animation of opening and closing cells does not work normally.
Facing the same problem. @NrmeenTomoum 's trick works, but it makes the animation weird and it requires editing the library's file which is not acceptable for many cases. I'll try to contribute if I find out the solution to this, but is this project deserted?
Update#1: I tried and I'll still try, but I don't think I can find a solution to this without editing the library file. This is a serious problem and this library is no good with it. The bug happens way too often to just ignore. To anyone trying to use this library: might want to wait for this bug to be fixed. Otherwise, don't waste your time. Update#2: I'm now able to use the newest version 1.2.2, but the problem still remains in the newest version.
This is happening to me too. Did anyone solve this problem ?
@FaridHaddad Nope. I'll try to, but I don't think I can. Finding a new library would be better.
Which library can be a good alternative?
@superhard Well, this still is ExpandableCell's thread, so I can't discuss other libraries here.
Multiple reports and no definitive solution to the problem?
In addition, in the example application itself of this git the problem happens: expands all and goes opening and closing, and fiddling with scrool. You will see that they add up other unrelated items.
any one have found solution for this issue ??