Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cells randomly disappearing and titleLabel.text displays wrong text #23

Open
max-rosenblattl opened this issue Nov 12, 2017 · 19 comments
Open

Comments

@max-rosenblattl
Copy link

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

@andrei0929
Copy link

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

@NrmeenTomoum
Copy link

@younatics I have same problem

@NrmeenTomoum
Copy link

NrmeenTomoum commented Nov 24, 2017

@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
Copy link

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

@andrei0929
Copy link

andrei0929 commented Nov 29, 2017

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

@NrmeenTomoum
Copy link

NrmeenTomoum commented Nov 29, 2017

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

@shakenovdev
Copy link

shakenovdev commented Dec 5, 2017

@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

@NrmeenTomoum
Copy link

@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 .

@shakenovdev
Copy link

@NrmeenTomoum I tried your solution but animation becomes very weird

@NrmeenTomoum
Copy link

try to made animation of table . middle @damir18yo

@akominch
Copy link

akominch commented Jan 10, 2018

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.

@Sunnymous
Copy link

Sunnymous commented Jan 31, 2018

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.

@FaridHaddad
Copy link

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

@Sunnymous
Copy link

Sunnymous commented Feb 8, 2018

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

@superhard
Copy link

Which library can be a good alternative?

@Sunnymous
Copy link

Sunnymous commented Feb 14, 2018

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

@jonasrotilli
Copy link

Multiple reports and no definitive solution to the problem?

@jonasrotilli
Copy link

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.

@AhmedAmineZribi
Copy link

any one have found solution for this issue ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants