Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Confusing row setup examples in README #8

Open
jpmhouston opened this issue Mar 13, 2018 · 0 comments
Open

Confusing row setup examples in README #8

jpmhouston opened this issue Mar 13, 2018 · 0 comments

Comments

@jpmhouston
Copy link

In the Prepare a Row section of the README:

let rowItaly = Row<CountryCell>(model: italy, { row in
    row.onDequeue = { _ in
        self.countryNameLabel.text = country.name.capitalized()
    ...

In earlier code sample its never made explicit where countryNameLabel comes from, but its somewhat obvious that its a property of a CountryCell. And country comes from thin are, but is clearly supposed to be the model, italy in this specific case.

So in the last line I quote above, should self and country instead be row.cell and row.model?

In this section where the example adds a single row, the model is kind of useless because the code could just reference italy in line. Where the model is useful is when adding many instances of the same model, and currently the reader is left to make that connection herself. You might instead want this section to show how to make a row that doesn't use a model, and have it focus on the event properties, then mention the model in the following section "Prepare Rows for an array of model" where the present example omits the callback altogether.

Are there cases when you can do that, omit that callback, maybe if the model is just a string and one is using default UITableViewCell title layout? If you want to show some examples that do that and how the code is simpler for those cases, you should talk about it explicitly and don't just omit the callback from one example without explanation.

Cool project, I think I'll use it in the future.

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

No branches or pull requests

1 participant