Closed KrauseFx closed 11 years ago
I can implement this feature if you want. Just wanted to ask first, to be sure I'm not missing something obvious.
I don't think it's a good idea to mass assign cell style on a class level. In most of the cases the cell style will depend on a particular item and its attributes. Each item has the style
property:
RETableViewItem *item = [RETableViewItem item];
item.style = UITableViewCellStyleValue1;
Let's say I have a GCAppointmentItem class which represents an appointment. Every time I present an appointment I want to display the title and the name. I'd have to set the style manually every time I create a GCAppointMentItem (when I don't want to override the initializer), instead of setting it once as default. Does that make sense?
Right, so in your subclass' initializer override the style, that seems logical to me. This is your edge case, there's a possibility of a million edge cases where people would want to define, say, custom text color for each cell type, etc. I have the main goal of keeping it simple by getting rid of UITableViewDelegate
burden.
I wanted to set the cell style of my cells (e.g. UITableViewCellStyleValue1, UITableViewCellStyleValue2)
As far as I found out the only easy way to do that is to subclass ReTableViewItem, override the initializer and set the style there.
Wouldn't it be better to set it like this from outside without the requirement to subclass:
What do you think?