The custom cell files are attached. Here is the code where I am using it. The code never reaches the .cellSetup.
form +++ SelectableSection<ItemOptionRow>() { section in
}
form.last! <<< ItemOptionRow() { optionRow in
optionRow.selectableValue = Option(name: "Test", price: 9.99)
optionRow.cell.optionName.text = "Test"
optionRow.value = nil
}.cellSetup { cell, _ in
cell.trueImage = #imageLiteral(resourceName: "selectedRadioBox")
cell.falseImage = #imageLiteral(resourceName: "unselectedRadioBox")
}
Same
Any updated or suggestions?
Hey guys !
The issue is that you are accessing the cell in the _constructor_ callback(let's call it this) and thus the cellSetup callback gets called before even being set, here, and never again.
What you want to do is move every cell config to the cellSetup callback and just leave row configs in the constructor callback, like so:
form +++ SelectableSection<ItemOptionRow>()
form.last! <<< ItemOptionRow() { optionRow in
optionRow.selectableValue = Option(name: "Test", price: 9.99)
optionRow.value = nil
}
.cellSetup { cell, _ in
cell.optionName.text = "Test"
cell.trueImage = #imageLiteral(resourceName: "selectedRadioBox")
cell.falseImage = #imageLiteral(resourceName: "unselectedRadioBox")
}
Cheers
Closing due to lack of response
Most helpful comment
Hey guys !
The issue is that you are accessing the cell in the _constructor_ callback(let's call it this) and thus the
cellSetupcallback gets called before even being set, here, and never again.What you want to do is move every cell config to the
cellSetupcallback and just leave row configs in the constructor callback, like so:Cheers