maxsokolov / TableKit

Type-safe declarative table views.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to reload a concrete row or cell?

GDXRepo opened this issue · comments

How can I reload a concrete row or cell? If I try to enumerate sections and rows inside them, then I'm unable to perform type casting ("Row" class has no useful data, but casting to "TableRow" is impossible due to its generic parameter). Also from the "Row" I can't access its data to read or modify it. Replacing the row with the new TableRow and reconfiguring it is very inconvenient and inappropriate for me.

Hey @GDXRepo

You could keep a ref to a row somewhere

let row = TableRow<ConfigurableTableViewCell>(item: "Data", actions: [])

and then access it's item that you want to modify

row.item

then, if it's easy to calculate an indexPath you can easily call UITableView for update at indexPath.

Hmm. Thank you, I'll try it.