ExpandableCell icon indicating copy to clipboard operation
ExpandableCell copied to clipboard

Cells randomly disappearing and titleLabel.text displays wrong text

Open max-rosenblattl opened this issue 8 years ago • 19 comments

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

max-rosenblattl avatar Nov 12 '17 14:11 max-rosenblattl

I have the same issue. When scrolling, the expanded cells randomly disappear image uploaded from ios

andrei0929 avatar Nov 14 '17 07:11 andrei0929

@younatics I have same problem

NrmeenTomoum avatar Nov 22 '17 08:11 NrmeenTomoum

@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

NrmeenTomoum avatar Nov 24 '17 20:11 NrmeenTomoum

@Marolicious @andrei0929 @kwongius @ezefranca @kennydust waiting your respond

NrmeenTomoum avatar Nov 24 '17 20:11 NrmeenTomoum

@NrmeenTomoum Although I wasn't implementing the didSelectRowAt indexPath method, I called reloadData in the method but it didn't help me

andrei0929 avatar Nov 29 '17 09:11 andrei0929

are you added tableView.reloadData() at the End of didSelectRowAt func in ExpandableTableView.swift File created by @younatics ? @andrei0929

NrmeenTomoum avatar Nov 29 '17 11:11 NrmeenTomoum

@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

shakenovdev avatar Dec 05 '17 09:12 shakenovdev

@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 avatar Dec 05 '17 16:12 NrmeenTomoum

@NrmeenTomoum I tried your solution but animation becomes very weird

shakenovdev avatar Dec 05 '17 16:12 shakenovdev

try to made animation of table . middle @damir18yo

NrmeenTomoum avatar Dec 09 '17 09:12 NrmeenTomoum

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.

akominch avatar Jan 10 '18 20:01 akominch

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.

Sunnymous avatar Jan 31 '18 06:01 Sunnymous

This is happening to me too. Did anyone solve this problem ?

FaridHaddad avatar Feb 07 '18 11:02 FaridHaddad

@FaridHaddad Nope. I'll try to, but I don't think I can. Finding a new library would be better.

Sunnymous avatar Feb 08 '18 03:02 Sunnymous

Which library can be a good alternative?

superhard avatar Feb 13 '18 16:02 superhard

@superhard Well, this still is ExpandableCell's thread, so I can't discuss other libraries here.

Sunnymous avatar Feb 14 '18 05:02 Sunnymous

Multiple reports and no definitive solution to the problem?

jonasrotilli avatar Aug 06 '19 14:08 jonasrotilli

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.

jonasrotilli avatar Aug 06 '19 14:08 jonasrotilli

any one have found solution for this issue ??

AhmedAmineZribi avatar Feb 07 '20 08:02 AhmedAmineZribi