Giter Club home page Giter Club logo

Comments (8)

younatics avatar younatics commented on August 14, 2024

Hello @Rashesh-Bosamiya,
Is there any problem when you use reloadData function?

from ynexpandablecell.

Rashesh-Bosamiya avatar Rashesh-Bosamiya commented on August 14, 2024

Actually I am using this library for showing filter options.

I have 7 different filters in each cell. Each filter has option to choose, when user choose any option from any cell's attached view, I have to reload whole tableView to highlight selected option.

Here is the problem, where I reload the whole tableView. It causes too much of dwindled performance.

So it's better to reload particular cell which needs refresh.

from ynexpandablecell.

younatics avatar younatics commented on August 14, 2024

Hello @Rashesh-Bosamiya,
Maybe you can beginUpdate and reloadRowsAtIndexPaths and endUpdate
Is it helpful for you?

from ynexpandablecell.

Rashesh-Bosamiya avatar Rashesh-Bosamiya commented on August 14, 2024

I have tried reloadRowsAtIndexPaths, but this reload only cell(s) not attached UIView's.

But not with beginUpdate & endUpdate.

I'll try with beginUpdate & endUpdate & inform you.

But you got my problem right?

from ynexpandablecell.

younatics avatar younatics commented on August 14, 2024

Sure. I fully understand what you mean. If you can't do this, I will try in this weekend.
Cheers!

from ynexpandablecell.

Rashesh-Bosamiya avatar Rashesh-Bosamiya commented on August 14, 2024

My suggestion.

Can we have a method like tableView.expandCell(at indexPath:IndexPath)? or tableView.refreshCell(at indexPath:IndexPath)

That expand or refresh particular cell programmatically. informally we can achieve our goal to reload particular cell and its attached expandable view as well.

self.tableView.expandAll() kind of similar to this function.

from ynexpandablecell.

Rashesh-Bosamiya avatar Rashesh-Bosamiya commented on August 14, 2024

Finally, I found out!

I just need to call reloadRowsAtIndexPaths.

The problem was:

I was passing incorrect indexPath in reloadRowsAtIndexPaths function.

I have return 6 in numberOfRowsInSection method.

Now, this library internally makes double numberOfRowsInSection as addition to expandable element.

Now if I want to reload 6th row, I just need to call tableView.reloadRows(at: [IndexPath(row: 6, section: 0)], with: .automatic)

By the way Thanks for you efforts and Interest.

from ynexpandablecell.

younatics avatar younatics commented on August 14, 2024

Great! Thank you for contributing this library :)

from ynexpandablecell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.