Hey everyone!
I've got a UITableView and want to fill it with cells that expand to either show a UIlabel with some additional info or a UIImage when tapped. Googling shows mostly solutions for phone book like apps and they all use sections (one for each letter) and rows within that section (for the actual person entry).
How I solved it:
Create multiple prototype cells with one subclass of UITableViewCell for each, set some parameter in didSelectRowAt & reload the table load there too, then just pick the right prototype cell according to that parameter in cellForRowAt.
This seems like a pretty easy and straight forward way of doing this and yet I haven't come across anyone else doing it that way. Are there any performance problems doing it like this and that's why nobody is? What's the recommended way of doing this when the expanded part of your UITableViewCell doesn't look the same for every cell?
I've got a UITableView and want to fill it with cells that expand to either show a UIlabel with some additional info or a UIImage when tapped. Googling shows mostly solutions for phone book like apps and they all use sections (one for each letter) and rows within that section (for the actual person entry).
How I solved it:
Create multiple prototype cells with one subclass of UITableViewCell for each, set some parameter in didSelectRowAt & reload the table load there too, then just pick the right prototype cell according to that parameter in cellForRowAt.
This seems like a pretty easy and straight forward way of doing this and yet I haven't come across anyone else doing it that way. Are there any performance problems doing it like this and that's why nobody is? What's the recommended way of doing this when the expanded part of your UITableViewCell doesn't look the same for every cell?