Sensible TableView cells can be fully customized using three main ways:
1. If you are creating the cells yourself and adding them to the section, then you can simply customize them using their properties. For example:
SCTextFieldCell *textFieldCell = [SCTextFieldCell cellWithText: @"Name" withPlaceholder: @"enter name" withBoundObject:myObject withTextFieldTextPropertyName: @"name"];
textFieldCell.height = 60;
textFieldCell.textField.backgroundColor = [UIColor clearColor];
textFieldCell.backgroudView = myBackgroundView;
textFieldCell.imageView = myImageView;
2. If you have Sensible TableView generate the cells for you, then you customize their appearance using delegates: Sensible TableView model (
SCTableViewModel) fires two main methods to allow full cell customization:
a.
tableViewModel:willConfigureCell:forRowAtIndexPath, which allows for customizing
SCTableViewCell properties such as the height or editable. For example:
- (void)tableViewModel:(SCTableViewModel *) tableViewModel willConfigureCell:(SCTableViewCell *) cell forRowAtIndexPath:(NSIndexPath *) indexPath
{
cell.height = 60;
cell.editable = FALSE;
cell.movable = FALSE;
}
b.
tableViewModel:willDisplayCell:forRowAtIndexPath:, which allows for customizing everything relating to
SCTableViewCell appearance. For example:
- (void)tableViewModel:(SCTableViewModel *) tableViewModel willDisplayCell:(SCTableViewCell *) cell forRowAtIndexPath:(NSIndexPath *) indexPath
{
((SCControlCell *)cell).control.backgroundColor = [UIColor clearColor];
cell.backgroudView = myBackgroundView;
cell.imageView = myImageView;
}
Please also note that similar methods are also fired per individual cell if you conform to the
SCTableViewCellDelegate.
3. For customizations such as adding buttons or more user controls to the cell, you can simply inherit from
SCTableViewCell or any of its subclasses, then add all your controls.