TGRDataSource
TGRDataSource copied to clipboard
Support for data sources with heterogeneous cell reuse identifiers
trafficstars
This PR has a solution for the case of an implementation that uses more than one reuse identifier on the data source. This happens when the view is composed by heterogeneous cells.
The idea is to use a block that provides the reuse identifier for a cell on the given index path. There are some handy new initializers for this case, that will take the reuse identifier block instead of a single reuse identifier string.
@rafaelwinter Looks good! My only suggestion would be to implement
-initWithCellReuseIdentifier:configureCellBlock: using
-initWithReuseIdentifierBlock:configureCellBlock: and make the latter the designated initializer.