Git Product home page Git Product logo

Comments (2)

croossin avatar croossin commented on July 23, 2024

Hi @richardtop - thanks for the question!
If you are asking if the cards are able to be a dynamic height and have an infinite amount of cells in it, then yes, it certainly can!

Let's take the Snapchat example:
For simplicity, we will just take about the best friends card and the recent card.
You can achieve that by having 2 CardPartTableViews with custom CardPartTableViewCardPartsCells. In your viewModel you could store the logic to filter/sort whom is a best friend and whom is a recent contact. Then you would bind that array of data to each of the tableView's. If for instance, you had 100 recent contacts, your table view would have 100 cells and the card would dynamically grow to be large enough to fit all cells.

Feel free to let us know if you have any other questions!

from cardparts.

richardtop avatar richardtop commented on July 23, 2024

Hi @croossin, thank you for your prompt response.
I guess, I was misunderstood - my question was about supporting cell reuse in the UITableView in the aforementioned configuration.

I give CardPartTableView a try and increased the number of rows in the example project, so that my ViewModel now looked like this:

class CardPartTableViewModel {

    let listData: Variable<[String]> = Variable([])
    
    init() {
        
        var tempData: [String] = []
        
        for i in 0...100 { // Increased  the number of cells to 100
            tempData.append("This is cell #\(i)")
        }
        
        listData.value = tempData
    }
}

However, it seems that the UITableView is displayed fully, without the cell reuse. Is there any way to configure the CardPartTableView supporting the built-in cell reuse behavior?

The example of a result I'm trying to achieve:
image

from cardparts.

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.