I have 3 custom cells to be displayed in one tableview of 50 rows. I found a reference which satisfies my need at Multiple Custom Cells dynamically loaded into a single tableview
It seems it gets complicated to create objects for cells. As per my need 3 cells do same functionality but views are different,
can we use a factory pattern to build cells?
Is there any implementation for this kind of pattern?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// I would like to create object some like this
CustomCell *cell = factory.getCell("customCell1", tableView);
}
I have the class diagram for custom cells.