Using blocks for the cell configuration is not the best idea. The initial reason why I went for that alternative was because I didn't liked the other alternative: using a delegate for the cell configuration.
Specially since that would mean that you could use a DATASource instance that did nothing since the configuration block wasn't provided by default.
But I was wrong, even though is not the best paradigm, is a common paradigm. For example you can easily instantiate a UITableView that does nothing. You have to actually implement it's data source before it can display data. It's a common paradigm, not the best, but is not rare neither.
To not break all the existing apps that are using DATASource right now, I'm providing this implementation as an alternative instead of a replacement.
Using blocks for the cell configuration is not the best idea. The initial reason why I went for that alternative was because I didn't liked the other alternative: using a delegate for the cell configuration. Specially since that would mean that you could use a DATASource instance that did nothing since the configuration block wasn't provided by default.
But I was wrong, even though is not the best paradigm, is a common paradigm. For example you can easily instantiate a
UITableView
that does nothing. You have to actually implement it's data source before it can display data. It's a common paradigm, not the best, but is not rare neither.To not break all the existing apps that are using DATASource right now, I'm providing this implementation as an alternative instead of a replacement.
So now you can do: