You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the Prepare a Row section of the README:
In earlier code sample its never made explicit where
countryNameLabel
comes from, but its somewhat obvious that its a property of a CountryCell. Andcountry
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
andcountry
instead berow.cell
androw.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.
The text was updated successfully, but these errors were encountered: